tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Run Applet on Tomcat 5.0 -- Where to put the plugin class files?
Date Thu, 26 Feb 2004 20:01:08 GMT

Please respond to the list, so everyone can see this conversation. Also 
note that this isn't really a Tomcat question. It's an applet question. 
However, I'm happy to help.

> 1. I put PluginApplet.jsp in the directory 
> [TomcarInstalledHome]\webapps\ROOT\

Okay, that should be fine. Since IE is trying to load your applet, I 
assume that the page is in the proper place.

> 2. I use IE to browse http://localhost/PluginApplet.jsp
> Result: IE failed in initializing PluginApplet.
> Where should I put the following 4 class files?
> DrawingPanel.class ,PluginApplet.class, TextPanel.class, 
> WindowUtilities.class

First of all, I highly recommend using a JAR file since you have 
multiple class files. I believe that most browsers will use the current 
base URI for loading classes, so your classes should be in the same 
directory as your PluginApplet.jsp file (or, at least, the URL created 
by replacing 'PluginApplet.jsp' with 'PluginApplet.class' should resolve 
to your class file.

> <jsp:plugin type="applet" 
>             code="PluginApplet.class"
>             width="370" height="420">
> </jsp:plugin>

You should, however, specify either the 'codebase' attribute for the 
jsp:plugin element, or use the 'archive' attribute, which would be 
required if you were to use a JAR file.

So, if you JAR'd all your class files together into, say, 
PluginApplet.jar, then your JSP code would look like this:

<jsp:plugin type="applet"
	... other attributes like width, etc. ...

Hope that helps.

View raw message