Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat cant find my form.html?

 
kyro gue
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i am following a head first servlets and jsp chapter 3 example, whereby i create a form.html , inside is purely html codes, and i put it in C:\tomcat\webapps\Beer-V1 . when i access http://localhost:8080/Beer-V1/form.html , i cant find the file. why is that? i have set my JAVA_HOME, CLASSPATH, and TOMCAT_HOME, tomcat_home is C:\tomcat . why is it that tomcat cant locate a simple file ? and if i understand the web.xml file should not have a relation with a HTML file , rather it is more for mapping a servlet.

Error message:
type Status report

message

description The requested resource () is not available.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the application in the deployed state ?

Are you able to access the servlets in the application ?
 
kyro gue
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
servlets yes, what do you mean deployed state?
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deployed state = The application has been deployed on the container.

Where did you place form.html ?
 
kyro gue
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
C:\tomcat\webapps\Beer-V1 folder

 
Sai Nara
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Avoid using -. Try to rename directory to BeerV1. Check the console for any exceptions. If you see any exception paste it here.
 
kyro gue
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it still cant find it. i attached a image to show my directory etc.
 
Prakash Mani - Attur
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
servlets working? it looks like you do not have the context path for 'BeerV1' app.. please check out server.xml and reply.. clean your work directory before you try..
 
venkatesh polneedi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think you miss to set classpath for servlet-api.jar or it may be problem in your web.xml file...s,gothrough that
 
kyro gue
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i currently do not have a servlet , i am just trying to access a plain html page using tomcat . i do not know how to edit the server and web.xml . what im doing is just following the head first servlets and jsp instructions and it cant work ;/
 
kyro gue
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FIXED, it appears there was a typo error of the web.xml

Correct version:


What i did:


did not pay much attention into the doctypes because i thought those were just stuffs that denote a document.
 
venkatesh polneedi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
your dtd information is not a problem...i think after deploy the application status of your project is false.this is due to syntax wrong in your web.xml..examine that one
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic