Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

page not found error

 
alwin das
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i am trying the code in headfirst java chapter 3
i am stuck on step1:

i have created form.html file and i have put it under tomcat\web-apps\Beer-v1 folder
but after typing http://localhost:8080/Beer-v1\form.html

i get error html page not found.

but if i place the same page under servlet-examples in the webapps folder its working.
http://localhost:8080/servlets-examples/Beer-v1/form.html

or
http://localhost:8080/servlets-examples/form.html


evenif i place Beer-v1 under root folder ,everything is workin fine.
http://localhost:8080/Beer-v1/form.html
my tomcat is running fine .
i am using command prompt for startup and shutdown commands
my tomcat_home is set to c:/tomcat (my installation dir)
catalina_home is set to c:/tomcat

what is going wrong..please help me out.
[ June 25, 2006: Message edited by: alwin das ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by alwin das:
hi,
i have created form.html file and i have put it under tomcat\web-apps\Beer-v1 folder


Two things:

One: It should be "webapps" not "web-apps".
Two: In order for Tomcat to recognize the Beer-v1 folder as a web application, you will need to create, under it, a WEB-INF folder.
 
alwin das
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes thank you very much.

previously i didnt have WEB-INF folder inside my Beer-v1 folder.

but i dont understnd this ...just to call a html page form.html why we need WEB-INF folder.

because once we click submit then only servlet class and DD will come into picture right?so till that it is just a static html page...so load tht why WEB-INF folder is required?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In order to be a proper J2EE web app, there must be a WEB-INF directory in the root directory of the application.

Tomcat doesn't just serve up files in directories as a plain web server would.
It deploys separate applications. The presence of the WEB-INF directory is what tells Tomcat that this folder is to be treated as a web application and not just another folder on the file system.
 
alwin das
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much.That was really of great help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic