Thanks for your reply.
I think I really DO need some help with this. For example I wrote the
following code, but does not compile:
public class JniServlet extends HttpServlet
{
public native void doGet(HttpServletRequest
request,HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html><head><title>JNI
Servlet</title></head><body>");
out.println("<h3>" + JniServlet().displayHelloWorld()
+"</h3>");
out.println("</body></html>");
}
public native void displayHelloWorld();
static {
System.loadLibrary("helloservlet");
}
}
Is this how you meant to code?
Thanks
-----Original Message-----
From: Manish Bhatnagar [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 21, 2001 8:00 AM
To: [EMAIL PROTECTED]
Subject: Re: How to use JNI with Servlets
Hello Qari!
There is not much of difference in using JNI with standalone application and
using it with Servlets.
You need to call the JNI using the same good old
System.loadLibrary("my_dll") method.
You did not mention which web-server you are using. I tell you for Tomcat.
After you have build the DLL, place it in $TOMCAT_HOME/lib.
That's it. Try it out.
If you are unable to get it working, please let me know.
I will mail you the working code.
-mb-
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of [Qari
Qasim]
Sent: Wednesday, June 20, 2001 8:11 PM
To: [EMAIL PROTECTED]
Subject: How to use JNI with Servlets
Hi
i was trying to do some example with JNI. I can use JNI with standalone Java
application but I just cannot figure out how I can use JNI with Servlet.
Can some one show me a sample code using JNI with Servlets.
thanks very much
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html