This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Applet in tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Applet in tomcat" Watch "Applet in tomcat" New topic
Author

Applet in tomcat

Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Hi, I was wondering if I place applet classes in the web-inf/classes directory, what shoud my code base be in the HTML applet tag?
Thanks.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
The answer is simple: You can't put applet classes in WEB-INF anywhere. The servlet API calls for this directory to be invisible to the web server. Applet classes must be in a normal web directory where the browser can request them.
The problem is that without an extra step, when looking at a HTML page created by a servlet, the browser will request resouces from the servlet directory. The extra step is to define a <base> tag in the head area of your html page. Use that base tag to point to resources such as class files, image files, etc.
Bill

------------------
author of:
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Applet in tomcat
 
Similar Threads
Applet not initiated
Applet & Application Reference
Downloaded applet file path In remote machine.
where should I put the serializable object class
how to use policy tool for Applets in java ?