• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

404 for .html in Tomcat 5

 
J Chitra
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64994
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does it mean to "ax" a page?
 
Joyce Lee
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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.
 
Sirisha Reddy
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • 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 ]
 
Roel De Nijs
Sheriff
Posts: 10240
129
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic