Java Applet embedded in a JSP Page
Hi
I am trying to include a Java Applet into a JSP page in my SAP MI application. The code is as follows:
<jsp:plugin type = "applet"
code = "com.mycompany.applet.myApplet.class">
</jsp:plugin>
It gave me a Class Not Found exception. If I place the class in the same directory that the JSP resides it works properly. It seems that I need to set the codebase and/or archive property to work. But every value I use to set them still gaves me the CLASS NOT FOUND Exception. I am using MI2.5 and the jar file is located at MYAPPS/WEB-INF/lib folder. Any suggestion will be appreciated.
[634 byte] By [
JLRodz] at [2007-11-11 6:50:00]

# 1 Re: Java Applet embedded in a JSP Page
I assume that the class not found is from the Java plugin in the browser when it tries to load your applet.
When the browser gets the HTML from the JSP page, it sees that it needs the applet class and issues an HTTP GET to the server for the class. It is possible with the archive attribute to specify a path to the class file.
Can you see what the path is on the HTTP GET being sent to the server? If you could see that, you would know where to put the class files so the GET can find them.
Does your server have a trace to show what it is receiving and returning?
The default path for the browser to use when getting need files for an HTML page, is the one that it used to get the HTML page itself. Use the archive= to change that for the applet class files.
Norm at 2007-11-11 22:40:05 >

# 2 Re: Java Applet embedded in a JSP Page
Whoops. I meant to say that the path to the jar file/class files should be in codebase= not archive=.
I'm not familiar with your server and can't say how it uses the paths it receives with an HTTP GET. They could be mapped anywhere on the server. Best to read the server's doc.
Norm at 2007-11-11 22:41:15 >

# 3 Re: Java Applet embedded in a JSP Page
Well after a little detour with a project I came back to this issue.
I got it work properly using codebase and archive on my laptop. But when I try to call the page on the mobile device it gave me the following error:
"Press OK to continue loading the content of the Page"
and then nothing.
The mobile device is using Pocket IE and CrEme for JVM. Do I need something else to make it work on the mobile device?
JLRodz at 2007-11-11 22:42:14 >
