File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes TomCat HTTP Status 404 - /TestServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "TomCat HTTP Status 404 - /TestServlet" Watch "TomCat HTTP Status 404 - /TestServlet" New topic
Author

TomCat HTTP Status 404 - /TestServlet

Harry Tuttle
Greenhorn

Joined: Apr 08, 2010
Posts: 24

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
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




i could fix the problem by modifying the above form action in


where mywebapp is the name of my web-application.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

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.

See the JSP FAQ for details.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TomCat HTTP Status 404 - /TestServlet
 
Similar Threads
tomcat execution problem and other thing
Cannot get Servlets Demystified Problem
servlet error
passing session values between two web application
websphere 7.0 JAXWS webservice deployed in tomcat 6.0.32 not working