aspose file tools*
The moose likes JSP and the fly likes Path on the webpage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Path on the webpage" Watch "Path on the webpage" New topic
Author

Path on the webpage

Noopur Kore
Ranch Hand

Joined: Aug 18, 2012
Posts: 77

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

Joined: Jan 10, 2002
Posts: 61418
    
  67

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).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Noopur Kore
Ranch Hand

Joined: Aug 18, 2012
Posts: 77



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

Joined: Jan 10, 2002
Posts: 61418
    
  67

I already showed you the EL expression used to avoid hard-coding the context path.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Path on the webpage