• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Path on the webpage

 
Noopur Kore
Ranch Hand
Posts: 77
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using a form with action as

<form name="form1" Id="form1" method="post" action="/InstLayout/inServlet">

using this the page is directly directed to the servlet. I want to map the path on web.xml. How am I supposed to do that? Here, InstLayout is project name and inServlet is my servlet name.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your JSP, the action should be prefixed by the app context path which should never be hard-coded. See the JspFaq for more info, but in a nutshell:

where servlet-path is whatever is mapped in the deployment descriptor.

Please post your web.xml (be sure to UseCodeTags).
 
Noopur Kore
Ranch Hand
Posts: 77
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Here, I'm done with my web.xml file and I don't want to hard code the path. How am I supposed to go about it.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I already showed you the EL expression used to avoid hard-coding the context path.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic