File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 13037
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:
I agree. Here's the link:
subject: servlet calling applet
It's not a secret anymore!