File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes HTTP Status 404 Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply locked New topic

HTTP Status 404 Error

Mark Henryson
Ranch Hand

Joined: Jul 11, 2005
Posts: 200

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.

How to resolve this?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63858

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 ]

[Asking smart questions] [About Bear] [Books by Bear]
Mark Henryson
Ranch Hand

Joined: Jul 11, 2005
Posts: 200
Yes, I am having that.

I am having the following folder structure:

Within web-inf, i am having the web.xml.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Are you getting any error messages in your log files?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Kattie Poppyseed

Joined: Jan 13, 2009
Posts: 1
Mark, you have problem with your deployment descriptor (web.xml). One ending bracket is missing:

# <web-app xmlns=""
# xmlns:xsi="" xsi:schemaLocation="" version="2.4">

After this fix, you should be able to see your form.html
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

This thread is four years old.
I'm sure that the original poster has either solved the problem or given up by now.
subject: HTTP Status 404 Error
It's not a secret anymore!