File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes question about Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "question about Servlets" Watch "question about Servlets" New topic

question about Servlets

Salman Faraz

Joined: Feb 14, 2005
Posts: 28
Respected Group Members,
I have written a function in C language and now I want to call it from my Servlet application,is it possible to call functions written in other languages from Servlets,do we have to use JNI for this purpose and can JNI be used with Servlets,how can we use JNI with servlets and what API will I need to start working on JNI.

Thanking You,
Salman Faraz.
D Rog
Ranch Hand

Joined: Feb 07, 2004
Posts: 472

You have to use JNI, unless you can warp your function in a webservice, CORBA IDL, or some other remote invokation approach. There is no problem calling native function from servlet. I'd recomend to put dll in bin directory inside war, then use getRealPath() of servlet context to specify path to dll in load function. You may want to check security settings, because some servlet container could not allow you to load dlls.

Retire your iPod and start with HD Android music player Kamerton | Minimal J2EE container is here | Light weight full J2EE stack | and build tool | Co-author of "Windows programming in Turbo Pascal"
I agree. Here's the link:
subject: question about Servlets
It's not a secret anymore!