Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

page not found error

 
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 ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • 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 VI Editor Redhat
  • 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.
 
Let's go to the waterfront with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic