Hello,
I also have problems getting the Head First
Servlets and
JSP example of chapter 3 (page 81) run.
After pressing the submit button of form.html I got an 404 error, saying
"description The requested resource (/Beer-v1/SelectBeer.do) is not available."
##########
What I did before:
0) Run Windows-XP-Home, Apache Tomcat/5.5.16, firefox-1.5.0.1-win with extension LiveHTTPHeader-0.12
1) I put the form.html to the place:
<tomcat-path>\webapps\ROOT\Beer-v1\form.html
with:
...
<form method="POST" action="SelectBeer.do">
...
2) Place the web.xml to:
<tomcat-path>\webapps\ROOT\Beer-v1\WEB-INF\web.xml
with:
...
<servlet>
<servlet-name>Ch3 Beer</servlet-name>
<servlet-class>com.example.web.BeerSelect</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Ch3 Beer</servlet-name>
<url-pattern>/SelectBeer.do</url-pattern>
</servlet-mapping>
...
3) Compiled BeerSelect.java and placed BeerSelect.class to:
<tomcat-path>\webapps\ROOT\Beer-v1\WEB-INF\classes\com\example\web\BeerSelect.class
4) Restart
Tomcat 5) type URL:
localhost:8080/Beer-v1/form.html which is transformed in my firefox-1.5.0.1-win to
http://localhost:8080/Beer-v1/form.html The html page is rendered.
After pressing the submit button, firefox extension LiveHTTPHeader shows /Beer-v1/SelectBeer.do is called:
...
POST /Beer-v1/SelectBeer.do HTTP/1.1
...
6) Got:
"HTTP Status 404 - /Beer-v1/SelectBeer.do
type Status report
message /Beer-v1/SelectBeer.do
description The requested resource (/Beer-v1/SelectBeer.do) is not available.
Apache Tomcat/5.5.16"
###########
7) I tried also Ben Southers "Simple Servlet" (
http://simple.souther.us./ar01s02.html) from his "Simple Servlets Examples" and got also error 404
(with his path structure <tomcat-path>\webapps\ROOT\mjs_SimpleServlet\WEB-INF\classes\us\souther\simple\SimpleServlet.class
instead of mine <tomcat-path>\webapps\ROOT\Beer-v1\WEB-INF\classes\com\example\web\BeerSelect.class ):
"HTTP Status 404 - /mjs_SimpleServlet/simple-servlet
type Status report
message /mjs_SimpleServlet/simple-servlet
description The requested resource (/mjs_SimpleServlet/simple-servlet) is not available.
Apache Tomcat/5.5.16"
######################
Does any of you has a hint for me?
Greetings Mike