• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

TomCat HTTP Status 404 - /TestServlet

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic