• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Apache/Tomcat simple applet problem

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 893
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic