File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Apache/Tomcat simple applet problem

 
Idris Pathan
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have installed Apache/Tomcat
Apache 2.2.4(Win32)
Tomcat Version - Apache Tomcat/6.0.9
JVM Version 1.5.0_10-b03
JVM Vendor Sun Microsystems Inc.
OS Name Windows XP

I am trying to run a simple applet - Hello.html, I can run this by just clicking on the html file and this is then displayed in my browser. There are no classes associated with this. The Hello.html file is located in tomcat\webapps\Hello.html.

When entering http://localserver:8080/Hello.html
I see the following error on the web browser

HTTP Status 404 - /Hello.html
type Status report
message /Hello.html
description The requested resource (/Hello.html) is not available.
Apache Tomcat/6.0.9

Can I run an applet that does not call a servlet in my Apache/Tomcat server ?


I am trying this out to make sure
1.)I can call a simple applet,
My next step would be to
2)call an applet that has classes
and then to
3)call an applet that uses servlets that have database access.

Any ideas as to why this is not working ? or any help would be greatly appreciated.

For the simple Servlet I have not changed anything in my server.xml file and I have not created a web.xml file either (am I right in thinking the web.xml file is only required for servlets ?)

thanks
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, there is no such thing as an "applet without classes". An applet is nothing but its classes.

As to the problem at hand, Tomcats root directory is not "webapps", but "webapps/ROOT". If you put the HTML file in there it should be found.
 
Idris Pathan
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf, thanks for the reply, yes adding the HTML in to the webapps/ROOT directory fixed the problem.

Thanks for that.

I am now trying to set up a applet that calls servlets to work.

I am not quite sure about what needs to be included in my web.xml.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Applet FAQ has a few links regarding how an applet might communicate with a servlet.

For servlet question, please start a new thread in the Servlets forum.
 
Remko Strating
Ranch Hand
Posts: 893
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would also put the Hello.html in de directory webapps, because by normal deployment the applications they are stored here.

Your tip puting them in the webapps/root is working.

I will remember this.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Individual files do not go in the webapps directory; web applications do.

A web application can be either a packaged war file or a directory structure that conforms to the servlet spec's definition (the root folder must contain a directory named "WEB-INF".

The ROOT folder under webapps is one web application.

If some more samples would help, I have several pre-packaged web apps at
http://simple.souther.us . Download any of those war files to your webapps directory and Tomcat will unpack and deploy them automatically.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic