Core Servlets and Java Server Pages tell me:
Once you compile HelloServlet.java, put HelloServlet.class in the appropriate location (usually the WEB-INF/classes directory of your server’s default Web application). […] Then, access the servlet with the URL http://host/servlet/HelloServlet […
Tomcat directory for Java .class files.
install_dir/webapps/ROOT/WEB-INF/classes (Note: in many Tomcat versions, you’ll have to manually create the classes directory.) […] http://localhost/servlet/HelloServlet (or http://localhost:8080/servlet/HelloServlet)
It neglected to say the following:
- Set the JAVA_HOME environment variable to point to the location of java. Mine is
servlet-mappingelements that map the
invokerservlet to /servlet/*.
Number Three above is the most important. Just look at the file web.xml and look for the word invoker. It’s in two places, and they are quite far apart from each other. There are loads of other places that have a element so be sure to uncomment the correct one.
It turns I found this solution by google, and it actually ended up on the author’s site, in case you need more information: http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-5.5.html