This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
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
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
description The requested resource (/mjs_SimpleServlet/simple-servlet) is not available. Apache Tomcat/5.5.16"
Ok, now it works after moving <tomcat-path>\webapps\ROOT\Beer-v1 to <tomcat-path>\webapps\Beer-v1.
Also Ben Southers "Simple Servlet" is running now after moving from <tomcat-path>\webapps\ROOT\SimpleServlet\ to <tomcat-path>\webapps\SimpleServlet\
That ROOT-Folder already existed after the Tomcat installation. There is the default jsp-page in which one sees after typing the URL: "localhost:8080".
There are still two questions: 1) Why the URL: "localhost:8080" leads to an error now after moving my Beer-v1 folder? [ "description The requested resource (Servlet org.apache.jsp.index_jsp is not available) is not available." ]
2) Why do the <tomcat-path>\webapps\jsp-examples don't run, as they are already in webapps folder?
Eduardo Dela Rosa
Joined: Apr 15, 2004
I would suggest reinstalling your Tomcat, as you might have messed it up because of your Beer?
Otherwise, check that the <tomcat-dir>\webapps\ROOT\WEB-INF\web.xml is intact and its content is still in order.
Take note of the following "NOTE" when you first install and run TOMCAT for the first time:
NOTE: This page is precompiled. If you change it, this page will not change since it was compiled into a servlet at build time. (See $CATALINA_HOME/webapps/ROOT/WEB-INF/web.xml as to how it was mapped.)
So whatever you do, don't blow it up, else the only option you've got is really - a reinstall.
Joined: Apr 09, 2006
I would suggest reinstalling your Tomcat
Ok I did a reinstall after deinstallation and total delete of ALL Tomcat files. After the reinstall i have in folder "<tomcat-dir>\webapps\":
What is the sutuation with these webapps:
A) "http://localhost:8080/" (ROOT), "localhost:8080/tomcat-docs" and "localhost:8080/webdav" succeed while displaying the rendered content.
B) "localhost:8080/balancer" brings me to "http://jakarta.apache.org/"
C) "localhost:8080/jsp-examples/", "localhost:8080/servlets-examples" failed with "The requested resource (/jsp-examples/) is not available." and "The requested resource (/servlets-examples/) is not available."
After copy back both folder "Beer-v1" and "SimpleServlet" into "<tomcat-dir>\webapps\" both ("localhost:8080/Beer-v1/form.html" and "localhost:8080/SimpleServlet") are sucessful. Section C still does not work.
I cant see any rule nor reason for that behaviour.
Anyway, my Beer-v1 webapp runs and I cant go on with the exercise in the book.
Eduardo thanks for your help. If anybody has a hint for that new behaviour please let me know.
subject: Head First Servlet JSP: BeerSelect example: requested resource not available