• Post Reply 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

404 for .html in Tomcat 5

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I have just installed Tomcat 5.0.28 and tried to axs a simple HTML page (tomcat/webapps/Project/form.html) thru localhost:8080/Project/form.html. Am getting a 404 error. I have nothing else in the 'Project' directory. Even when i tried naming the 'Project' directory a different one and tried to axs the HTML page, getting the same error!
can anyone explain?
CJ
 
J Chitra
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And I forgot to add:
Tomcat 5.0.28 works just fine with al the examples and this is just a simple static web page.
Many Tnx.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does it mean to "ax" a page?
 
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi CJ,

And I forgot to add:
Tomcat 5.0.28 works just fine with al the examples and this is just a simple static web page.
Many Tnx.



You need to create a WEB-INF subdirectory under PROJECT, i.e. /PROJECT/WEB-INF for the Tomcat to deploy the application. Since it's only html static pages, a web.xml file is not required under WEB-INF directory.

Alternatively, without the WEB-INF subdirectory, you still can access the html static pages by deploying the application manually using Tomcat Manager. Or you can add a Context under C:\tomcat-5.0.28\conf\Catalina\localhost. The first approach, just create a WEB-INF directory, is preferable.

Joyce
[ October 28, 2004: Message edited by: Joyce Lee ]
 
J Chitra
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joyce,
Many thanks. But its not still working.Even I added a web.xml to the WEB-INF under Project. Its not sill working.

Hi Bear,
axs=access.
 
Joyce Lee
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi CJ,

Many thanks. But its not still working.Even I added a web.xml to the WEB-INF under Project. Its not sill working.
Make sure the Tomcat has been shutdown before making the changes. If it is still not working, how about you try the following method?

Assuming that the http://localhost:8080/servlets-examples/helloworld.html is working fine. Make a copy of "servlets-examples" directory under webapps and rename it to any name, e.g. testing. So now under webapps, a new application called "testing" is created and its contents are similar to servlets-examples. Startup the tomcat and see if you can run this new application http://localhost:8080/testing/helloworld.html.

Joyce
 
J Chitra
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its working. The server was not shutdown the last when i made the changes in the PROJECT directory.
Thanks Joyce.
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I ran into the same problem.. and it was solved after adding web-inf folder.

But what is the logic behind it.. any comments.

Sirisha
[ November 15, 2004: Message edited by: Sirisha Reddy ]
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sirisha Reddy:
But what is the logic behind it.. any comments.

Sirisha



Tomcat is really picky on this, so for each webapp, you must have a WEB-INF directory underneat it, because else it won't work. no other logic
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic