Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP Status 404 -/UserInput.jsp

 
Anu katoch
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I am getting error HTTP Status 404


when I am sending respose as response.sendRedirect("/UserInput.jsp);

UserClass.java



Serlvet Controller.java



Web.XML



Please help me for the same Thanks in advance
 
Saif Asif
Ranch Hand
Posts: 440
Eclipse IDE Hibernate Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are giving the path "/UserInput.jsp" to response.sendRedirect(). It will be looking for the jsp at the root of the tomcat (http://localhost:8080/UserInput.jsp) , thus the 404 error. You will have to give an absolute path to sendRedirect to the other resource.
 
Anu katoch
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My absolute path for tomcat is C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\Store\UserInput.jsp

where store is my application which is deployed in tomcat webapps directory so i have changed my path as response.sendRedirect("/Store/UserInput.jsp");

now it is giving me error HTTP Status 404 -Store/Store/UserInput.jsp Resource Not Found and URL it is forming http://localhost:8080/Store/Store/UserInput.jsp.
 
Ivan Jozsef Balazs
Rancher
Posts: 992
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this:
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anu katoch wrote:My absolute path for tomcat is C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\Store\UserInput.jsp

where store is my application which is deployed in tomcat webapps directory so i have changed my path as response.sendRedirect("/Store/UserInput.jsp");

now it is giving me error HTTP Status 404 -Store/Store/UserInput.jsp Resource Not Found and URL it is forming http://localhost:8080/Store/Store/UserInput.jsp.


That is because Tomcat deals in web application relative paths, not your directory paths, when serving a resource.

Bill
 
Saif Asif
Ranch Hand
Posts: 440
Eclipse IDE Hibernate Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at what Bill is saying.
That is because Tomcat deals in web application relative paths, not your directory paths, when serving a resource.

This is a big hint.

And have you considered what Ivan has suggested ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!