Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
    Bookmark Topic Watch Topic
  • New Topic

HTTP Status 404 Error

 
Mark Henryson
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?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Are you getting any error messages in your log files?

{tomcat}/logs
 
Kattie Poppyseed
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 Redhat VI Editor
  • 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.
 
    Bookmark Topic Watch Topic
  • New Topic