You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Jost, Dominique" <do...@csg.ch> on 2001/03/02 15:45:01 UTC

loading applet from web-inf/classes sunfolder

hi

my home-directory on the tomcat server looks like this http://localhost:8080/fundopt. under fundopt i have a folder (called jsp) containing all my jsp files. 
i want to acces an applet (which has its source files in the web-inf/classes/xy folder) with the following piece of code:
from jsp file (in http://localhost:8080/fundopt/jsp/appletCaller.jsp)
<applet CODE=myApplet.class codebase=../classes/xy/ width="100" height="100">. this however doesn't work. 

how can i address the applet? what codebase am i to choose?

any help is appreciated

regards
dominique jost

server xml:
<Context path="/fundopt"
docBase="webapps/fundopt"
crossContext="false"
debug="0"
reloadable="true" >
</Context>

This message is for the named person's use only.  It may contain 
confidential, proprietary or legally privileged information.  No 
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please immediately delete it and all
copies of it from your system, destroy any hard copies of it and notify the
sender.  You must not, directly or indirectly, use, disclose, distribute, 
print, or copy any part of this message if you are not the intended 
recipient. CREDIT SUISSE GROUP and each of its subsidiaries each reserve
the right to monitor all e-mail communications through its networks.  Any
views expressed in this message are those of the individual sender, except
where the message states otherwise and the sender is authorised to state 
them to be the views of any such entity.




Re: loading applet from web-inf/classes sunfolder

Posted by William Brogden <wb...@bga.com>.

"Jost, Dominique" wrote:
> 
> hi
> 
> my home-directory on the tomcat server looks like this http://localhost:8080/fundopt. under fundopt i have a folder (called jsp) containing all my jsp files.
> i want to acces an applet (which has its source files in the web-inf/classes/xy folder) with the following piece of code:
> from jsp file (in http://localhost:8080/fundopt/jsp/appletCaller.jsp)
> <applet CODE=myApplet.class codebase=../classes/xy/ width="100" height="100">. this however doesn't work.
> 
> how can i address the applet? what codebase am i to choose?
> 

The form of codebase you are using only works for plain HTML
pages. One easy way to solve this problem and also make image
and sound files work right is to put a <base> tag in
the <head> section of the page your JSP writes. Use that
tag to point to the server alias for the directory that
has your class files. 



-- 
WBB - wbrogden@lanw.com
Java Cert mock exams http://www.lanw.com/java/javacert/
Author of Java Developer's Guide to Servlets and JSP 
ISBN 0-7821-2809-2