Java and OCX
how do i call an ocx from a java servlet. the servlet is running in tomcat, which is in microft iis, which is in a nt os.
what packages/classes do i need?
Web Development
how do i call an ocx from a java servlet. the servlet is running in tomcat, which is in microft iis, which is in a nt os.
what packages/classes do i need?
by michael
You'll need to use the Java Native Interface (JNI) features of the Java 1.1 or 1.2 platform. Warning - this is an advanced area of Java programming.
The Java language allows you to invoke platform-specific "native" methods (like Activex / OCX on an Win32 platform) by creating a Java "wrapper" class.
This "wrapper" class describes the "signature" of the native object (what you have to provide it with and what you receive in return). Next, you need to write, compile and link "glue code" in C or C++. This is loaded by the JVM (Java runtime environment) to actually invoke the OCX (or other native object).
The "glue code" may be quite simple, but can also get pretty complex. You have to use special JNI functions for conversion or formatting of parameter data. You have to be careful about releasing variables to prevent memory leaks. You also have to have a pretty good grasp of error event handling in Java.
The good news is that Java 2 has expanded the usefulness of these JNI functions and made them more safe to use.
Find out more at the following Sun Web page:
http://java.sun.com/docs/books/tutorial/native1.1/index.html
by cbrand
by cbrand
This discussion is closed to new replies.
Sort by Trending