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

servlet mapping not working as expected

 
shivang sarawagi
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65545
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
shivang sarawagi
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Sir !! The spec cleared my concept on using relative links in a web app.
 
The City calls upon her steadfast protectors. Now for a tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!