Re: Run Applet on Tomcat 5.0

2004-02-26 Thread Christopher Schultz
Henry,

Is anyone know where is Web-accessible directory in Tomcat 5.0.16?
A web-accesible directory is anywhere you could put a JSP or HTML file 
or image. Just some place where a URL can point to the class file and 
the server will give the browser access to it.

-chris


signature.asc
Description: OpenPGP digital signature


Re: Run Applet on Tomcat 5.0 -- Where to put the plugin class files?

2004-02-26 Thread Christopher Schultz
Henry,

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
code=PluginApplet.class
archive=/path/to/PluginApplet.jar
... other attributes like width, etc. ...
/jsp:plugin
Hope that helps.
-chris


signature.asc
Description: OpenPGP digital signature


Run Applet on Tomcat 5.0

2004-02-26 Thread Henry Lai
I tried to download PluginApplet.jsp from chapter 13 in Marty Hall's Core 
Servlets and JavaServer Pages 2nd Edition. In the document, it words 
.Remember that applets are executed by the browser, whereas servlets and JSP 
pages are executed by the server. Thus, the applet .class file goes in the regular 
Web-accessible directory, not in WEB-INF/classes.   at 
http://volume1.coreservlets.com/archive/index.html
(Chapter 13: Including Files and Applets in JSP Pages )

Is anyone know where is Web-accessible directory in Tomcat 5.0.16?