This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes accessing html file under tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Servlets
Bookmark "accessing html file under tomcat" Watch "accessing html file under tomcat" New topic

accessing html file under tomcat

vineeta gup

Joined: Oct 25, 2004
Posts: 3
just started on head first servlets and jsp.
am stuck on ch3. have form.html at tomcat\webapps\Beer-v1\form.html. when i type http://localhost:8080/Beer-v1/form.html get error-404. how to access form.html??
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 641
Check if this url http://localhost:8080/Beer-v1/ gives 404 error or displays files under Beer-v1,If it displays files then It will show form.html as well.
if it gives 404 then I guess your Beer-v1 webapp is not registered.
one of the way to register it is create a xml file called Beer-v1.xml under tomcat\webapps\Beer-v1\ with following content and restart your tomcat

[ October 25, 2004: Message edited by: Praful Thakare ]

All desirable things in life are either illegal, banned, expensive or married to someone else !!!
vineeta gup

Joined: Oct 25, 2004
Posts: 3
tried making the Beer-v1.xml file as suggested. i still get the Http error 404 when i type http:\\localhost:8080\Beer-v1\form.html.
Fisher Daniel
Ranch Hand

Joined: Sep 14, 2001
Posts: 582
Hi Vineeta Gup,
You should try to go http://localhost:8080/Bear-v1
If there is error 404, you should check whether you have provided the proper web.xml on your web application and tomcat configuration files to register your web application.
If there is no error 404, you should check whether you have pleced form.html in the right directory.
I mean here your html files is not inside WEB-INF directory.

Hope this helps...
Correct me if I am wrong
vineeta gup

Joined: Oct 25, 2004
Posts: 3
hi Praful Thakre, Daniel Fisher
thanx for the help. the html is working now.
I agree. Here's the link:
subject: accessing html file under tomcat
It's not a secret anymore!