This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes servlet mapping not working as expected Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet mapping not working as expected " Watch "servlet mapping not working as expected " New topic
Author

servlet mapping not working as expected

shivang sarawagi
Ranch Hand

Joined: Jun 19, 2008
Posts: 147
Hi,

My servlet mapping in web.xml is not working fine. I have double checked but not sure what is the issue.
Can anyone please help.

Here is my servlet mapping




from login.jsp which is under webContent/jsp/login.jsp



I am submitting the form. But on clicking submit I don't know why the flow is going to this path

"http://localhost:8080/ShoppingCart/jsp/ValidateUser"

the servlet is under src/org.techniker. The flow should rather go to org.techniker package

I am getting the error http 404 resource not found.

Please help
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60766
    
  65

Because you are using a page-relative URL in the action. Use a server-relative URL that starts with the context path. See the ServletsFaq fro more information.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
shivang sarawagi
Ranch Hand

Joined: Jun 19, 2008
Posts: 147
Thanks a lot Sir !! The spec cleared my concept on using relative links in a web app.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet mapping not working as expected
 
Similar Threads
Servlet Mapping
Running sample Beehive NetUI Tutorial using Tomcat
JSP not able to find the servlet
getting 404 error
Tomcat error??