[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Can I connect JSP to C++ code?

Posted on 2004-11-19
6
Medium Priority
?
178 Views
Last Modified: 2010-04-01
I want to create a client/server application which is web based, I want to write my server in C++ because I have to make Win32 calls and it's just easier to do it in C++. Could anyone tell me what language I should use for the web based (client) side? The language that I would be more familar with is Java so I was hoping to use something like JSP, would this be possible? If so how could I connect the client and server (sockets?) ? and if it's not possible to use JSP could someone suggest another way.
0
Comment
Question by:Dcom4CIT
  • 5
6 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 12623909
So you want to have 2 servers?

C++ server  -->  Web Server -->  Client browser

?

If your C++ application (server?) is a DLL, then you can call it using JNI:

http://java.sun.com/docs/books/tutorial/native1.1/

Of course, you could skip the C++ layer, and just write something that uses a library like JaWin: http://jawinproject.sourceforge.net/jawin.html

JaWin is a library that helps you call Win32 methods from java (via JNI)
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12623917
So you could just have JSPs which call Jawin (is what I meant by all the above waffle) ;-)
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12623925
http://www.relevancellc.com/halloway/JavaWin32.html

is a good list of other alternatives to Jawin...some free, some commercial
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:Dcom4CIT
ID: 12624541
I'll go into my project in a bit more detail to explain what I have to do. It's basically a project for college dealing with Storage Provision for hosts from EMC's Symmetrix, I'll be using some internal EMC API calls along with Win32 calls, the two of these type of calls are the core of the project and would be better done in C++. I would like to make this a web base application and basically don't know what technologies I could/should use.

One way I'm investigating is to have a C++ CGI on a webserver (Apache) which would do the core of the work and the data sent out as XML files (using REST), I was told that this would make the project language independant, so I could use JSP, PHP or whatever for the web frontend.

So could you tell me if this is the way to go or is there a better way? If there's not a better way then is there any useful wesites or books on this area?

And if there is a better way to do this project could you please explain it to me, basically all i want is a C++ program to do the work and have the results on the web.

I apologise in advance if the above doesn't make sense because it's all very new to me and I don't fully understand it myself.
0
 
LVL 35

Accepted Solution

by:
TimYates earned 1500 total points
ID: 12624629
Yeah, that sounds like a good way of doing it in that case :-)

If you write the C or C++ CGI script so that it takes parameters and outputs XML (as you say), you can then use something like JSPs and Servlets to interrogate this XML and send responses to the user...

One way to implement all this would be to use the Tomcat webserver as that supports JSPs and Servlets, and CGI.  See this

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/cgi-howto.html

For how to enable to CGI bit of tomcat (it should be a commented out block in conf/server.xml of tomcat, which you can uncomment to enable)

Hope I've helped a bit (at least) I haven't used CGI or C++ for years, I'm more of a java guy these days...

Tim
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12624632
PS:  Good luck!! :-)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

LinkedIn blogging is great for networking, building up an audience, and expanding your influence as well. However, if you want to achieve these results, you need to work really hard to make your post worth liking and sharing. Here are 4 tips that ca…
Last month Marc Laliberte, WatchGuard’s Senior Threat Analyst, contributed reviewed the three major email authentication anti-phishing technology standards: SPF, DKIM, and DMARC. Learn more in part 2 of the series originally posted in Cyber Defense …
Integration Management Part 2
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question