load dynamic library in jsp

J

j.du

hi,

i am developing a web application, in which i need to call dynamic
libraries in a jsp file. like
<% try {
System.loadLibrary("shtest");
} catch (UnsatisfiedLinkError e) {
System.exit(1);
}
%>
that's all right when i load the jsp, there are no error appeared, i
think that means i have no "path" related error in loading the
library. but when i add
<%= adder.add(10,20) %>
where adder is a class in the library, and add is just a function of
the class, into the jsp file, the server reports error that it do not
"know" class adder, can anybody give some tips? thanks in advance!

jasper
 
N

Naveen

First of all - I would strongly discourage you to keep System.exit or
System.loadLibrary in your JSPs.

That disclaimer said - you need to have a class which has native
methods and uses the dynamic library that you are loading. You then
use this class to call methods in the dynamic library. Check out any
decent tutorial on JNI to understand how to do this.

Thanks,
Naveen
Flexetech Solutions, Inc.
http://www.flexetech.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top