TomCat HTTP Status 404 - /TestServlet

I have a html-file named index.html with a send button that runs on Apache TomCat 7.0.2. When the send button is pushed a Servlet class named TestServlet should be executed, here call in the html-file

The problem is, when then send button is pushed, TomCat can't find the Servlet TestServlet. The details about TestServlet are:

- the TestServlet is in a package named testclass
- the TestServlet is stored in ../Apache Software Foundation/Tomcat 7.0/webapps/Signpad/WEB-INF/classes/testclass/
- The web.xml is in the folder ../Apache Software Foundation/Tomcat 7.0/webapps/Signpad/WEB-INF and looks like

i need help how to run TestServlet. can somebody help?

Harry Tuttle
Greenhorn

Joined: Apr 08, 2010
Posts: 24

posted Nov 10, 2010 16:06:28

0

Harry Tuttle wrote: I have a html-file named index.html with a send button that runs on Apache TomCat 7.0.2. When the send button is pushed a Servlet class named TestServlet should be executed, here call in the html-file

Hard-coding the context path and using an absolute URL will get you ito trouble. Use a server-relative path (starting with the context path) and programmatically obtain the context path from the request.