Can I connect JSP to C++ code?

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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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:

Of course, you could skip the C++ layer, and just write something that uses a library like JaWin:

JaWin is a library that helps you call Win32 methods from java (via JNI)
So you could just have JSPs which call Jawin (is what I meant by all the above waffle) ;-)

is a good list of other alternatives to Jawin...some free, some commercial
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Dcom4CITAuthor Commented:
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.
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

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...


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PS:  Good luck!! :-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.