This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, It's been years since the last time I used Tomcat. Now I'm using it again because I'm preparing for the SCWCD exam. I have created a simple servlet and deployed it to Tomcat but it doesn't work. I put the class file in <tomcat-dir>/webapps/myapps/WEB-INF/classes directory. I have created the web.xml file:
I have also set the JAVA_HOME, CATALINA_HOME, and the classpath to the file servlet.jar. But when I try to invoke the servlet using a browser by typing http://localhost:8080/myapps/servlet/myservlet, it shows HTTP status 404. What have I done wrong? Have I missed something? [ November 02, 2004: Message edited by: Yosi Hendarsjah ]
Which version of tomcat are you using? For Tomcat 5.0.28 or 5.XXX, the servlet api should be servlet-api.jar instead of servlet.jar. Tomcat 5 is based on Servlet 2.4 and JSP 2.0. Have you uncommented the <servlet> and <servlet-mapping> elements for the invoker in c:\tomcat\conf\web.xml. Also, if you've a servlet.jar under C:\jdk1.5.0\jre\lib\ext, remove or place the jar file in a temporary directory.