Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question about Servlets

 
Salman Faraz
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic