tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Brazhnyk <>
Subject RE: applet deployment/access
Date Tue, 22 Jan 2002 13:50:33 GMT

> -----Original Message-----
> From: cazza []
> Sent: Tuesday, January 22, 2002 3:27 PM
> To:
> Subject: applet deployment/access
> I have a servlet that generates html which contains a reference to the
> applet class under tomcat (the tomcat location is webapps/myapp/applet/)
> I understand that MyApplet.class cannot be under the web-inf directory for
> security reasons, but I have two questions;

I don't know any security reasons for applets to be not allowed in WEB-INF,
there is only one reason for them: User won't be able to access them there.
Applets are executed on client side, so browser's JVM should download .class

> 1) The applet class relies on other classes that are under the
> web-inf/classes directory.  How should my applet get access to these
> classes?

You should consider packing classes your applet needs and applet itself
to .jar and using appropriate syntax in <Applet>

> 2) MyApplet.class is also part of a package, which therefore builds under
> Tomcat to webapps/myapp/applet/com/companyname/packagename/MyApplet.class.
> I would like to set up a filter in the web.xml so that any reference to
> /applet loads the applet class.  Do I do it as follows?
> <filter>
>     <filter-name>Applet Filter</filter-name>
> <filter-class>com.companyname.packagename.MyApplet.class</filter-class>
> </filter>
> <filter-mapping>
>     <filter-name>Applet Filter</filter-name>
>     <url-pattern>/applet</url-pattern>
> </filter-mapping>

Why it should be filter, it looks like you need servlet or even just let Tomcat
serve it for you with default servlet (see answer on first question).
And you'd better use class name without .class in <filter-class> anyway. :)


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

View raw message