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 servlet calling applet 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 "servlet calling applet" Watch "servlet calling applet" New topic

servlet calling applet

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I have an applet which is displaying a message hello world
which is passed from a file.
hence iam using a servlet to read the file and pass it as a param name and i am getting it in the servlet but when i load the servlet in which the applet code is called it says class file cannot be loaded.I am using apache web server,Tom cat web server
pls reply to this as soon as possible
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12761
This is probably a problem with the way the browser tries to load applet class files. If you have not provided a complete url, the browser tries to get them based on the URL for the servlet. This also explains why you may have trouble loading <img> resources with just a file name.
The solution I like is to provide a base URL in the <head> area of the page. Use it to point to class files and other resources such as images.
<base href="http://server/path" >

author of:
It is sorta covered in the JavaRanch Style Guide.
subject: servlet calling applet
Similar Threads
Tomcat and IIS
where to store the applet file using JWS in servlet technology?
Multiple file upload using java applet
Tomcat and IIS
Basic concept in Applet-Servlet communication ?