i also tried to compile the SelectBeer.java using Eclipse (instead of using the command line) where i added the servlet-api.jar file to the libraries. this compiles fine and i managed to get the SelectBeer.class file --- which i then moved to:
then (did what it says on the book): 1. i restart tomcat 2. launch my browser and go to http://localhost:8088/Beer-V1/form.html - this loads my "Beer Selection Page" 3. then the SUBMIT button is clicked... and i get err 404... which means that the servlet is not working...
can anyone spot where i make the obvious (not so obvious to me) mistake
and for the CLASSPATH CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\common\lib\servlet-api.jar the PATH is set to PATH=%PATH%;%JAVA_HOME%
The JAVA_HOME environment variable should not point to the 'bin' directory. It should point to the root of your java installation (jdk1.5.0_6)
The PATH environment variable should point to the bin directory. (If you're getting class not found problems during compilation then the JDK install probably took care of this for you and is allowing your OS to find javac in spite of the mistake in your PATH entry).
Have you tested your CLASSPATH variable? Try typing:
It will print your CLASSPATH setting to the screen.
I had a hard time getting Tomcat set up properly also. Then i used this preconfigured setup, from the Author of Core servlets and JSP. Was compiling and running servlets 5 minutes later. Might be worth a try.
"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra