• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Slash in action

 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between:

<html:form action="/Lookup"...> and
<html:form action="Lookup"...>

It seems that both work with my action mapping definition:

<action path="/Lookup" ...>
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"/Lookup" is preferred because it will work in all cases. "Lookup" will not work if your current context is other than the root. For example, if your current JSP was displayed by the action "/foo/bar/MyAction", and you specify "Lookup", Struts will be looking for the action "foo/bar/Loookup".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic