Win a copy of Event Streams in Action this week in the Java in General forum!
    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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

HTTP Status 404 Error

 
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,

I am using Tomcat 4.1. When I started the Tomcat Server, it displays the index page of the tomcat.

I also tried the example JSP files in the webapps folder. (C:\Tomcat4.1\webapps\examples\jsp\dates)
It's working.

I have created a HTML file and put it in the following folder structure.
C:\Tomcat4.1\webapps\Beer-v1\form.html






How to resolve this?
 
Marshal
Posts: 67275
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Tomcat is not a web server in the way that Apache is. It is a servlet container and as such is geared to serving web applications. As such, you can't just drop files anywhere and expect things to work without a bit of structure.

Look at the other folders under webapps. Notice what they have in common?

They each have a WEB-INF sub-folder which contains a web.xml file.

This structure creates and defines an 'application context' for Tomcat to load.

So... if you want Beer-v1 to be loaded as a web app, you'll need to create a WEB-INF folder within it, and within that a minimal web.xml deployment descriptor.
[ July 15, 2005: Message edited by: Bear Bibeault ]
 
Mark Henryson
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Report post to moderator
Yes, I am having that.

I am having the following folder structure:
C:\Tomcat4.1\webapps\Beer-v1\WEB-INF

Within web-inf, i am having the web.xml.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Report post to moderator
Are you getting any error messages in your log files?

{tomcat}/logs
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
Mark, you have problem with your deployment descriptor (web.xml). One ending bracket is missing:

# <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
# xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">

After this fix, you should be able to see your form.html
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Report post to moderator
Kattie,
This thread is four years old.
I'm sure that the original poster has either solved the problem or given up by now.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!