Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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: 67451
173
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.
 
Did you miss me? Did you miss this tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic