File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

HTTP Status 404 Error

Mark Henryson
Ranch Hand

Joined: Jul 11, 2005
Posts: 200
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

Joined: Jan 10, 2002
Posts: 60049
    
  65

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] [Bear's FrontMan] [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:
C:\Tomcat4.1\webapps\Beer-v1\WEB-INF

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

Joined: Dec 11, 2004
Posts: 13410

Are you getting any error messages in your log files?

{tomcat}/logs


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

Joined: Jan 13, 2009
Posts: 1
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

Joined: Dec 11, 2004
Posts: 13410

Kattie,
This thread is four years old.
I'm sure that the original poster has either solved the problem or given up by now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP Status 404 Error
 
Similar Threads
Getting problem with post method
http 404 error
Problems with the Example from HF Servlets & JSP in Chapter 3
Tomcat 5.5 - application development
HTTP Status 404 problem