tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Deploying applet in a web app
Date Mon, 03 Dec 2001 00:28:30 GMT
On Fri, 30 Nov 2001, David Vinas wrote:

> Date: Fri, 30 Nov 2001 08:44:33 +0800
> From: David Vinas <>
> Reply-To: Tomcat Users List <>
> To:
> Subject: Deploying applet in a web app
> I have a web application which contains an applet which communicates
> with a servlet, and I am having trouble figuring out how to deploy it.
> My servlet shares some utility classes with my applet.  As per the
> Servlet API, the servlet should be deployed in the following location:
> <context>/WEB-INF/classes/servlet
> and the utility package:
> <context>/WEB-INF/classes/util
> But, although the spec mentions "Client side Java applets" (SRV.9.3),
> it is completely vague about where to put them.  I can only assume
> they mean that the applets should reside somewhere like:
> <context>/MyApplet.html
> <context>/classes/*.class
> Which creates a problem for the applet to access the utility classes,
> which are in a non-public folder.  I don't want to have to create
> copies of these classes, so I want them to be accessible by both the
> servlet and applet.
> I suppose there might be some way to create a mapping to
> WEB-INF/classes, but this would seem to violate the spirit of the API.
> On the other hand, I don't think I should put the applet under
> WEB-INF/classes for the same reason.  The only other way I can think
> is to put them in WEB-INF/lib, but I don't know how to give the applet
> access.
> Can anyone tell me the proper way to do this?  Is this something which
> has been overlooked in the spec?

>From the perspective of the web application, the .class and .jar files for
your applet are just static content, which are downloaded by the browser
when needed (just like image files are).  Therefore, these classes must be
in some location *other* than /WEB-INF to be visible to the browser.

It is not possible to share .class and .jar files between the webapp
itself and your applet -- you will have to duplicate the necessary files.

> -David

Craig McClanahan

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message