tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
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 <dvinas@mail.com>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> 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
> dvinas@mail.com
>

Craig McClanahan



--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message