• Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP Status 404

 
Mahtab Alam
Ranch Hand
Posts: 391
1
Java MySQL Database PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to run First Servlet example given in Head First Servlet Jsp book.


I compiled this class and put it in Tomcat 7.0\webapps\ch1\classes
I created This web.xml file

and put it in Tomact 7.0\webapps\ch1\WEB-INF

I can`t see any problem , It should work.Everything seems to be correct.
 
Mahtab Alam
Ranch Hand
Posts: 391
1
Java MySQL Database PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh , I get it my classes folder should be in WEB-INF folder.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<servlet-class>Ch1Servlet</servlet-class>


Your servlet class and all classes used in servlets/jsp MUST be in a package - reason being that the JVM will look for classes without a package in the "current" directory, not something you have control over.

Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!