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 Struts and the fly likes Slash in action 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 » Frameworks » Struts
Bookmark "Slash in action" Watch "Slash in action" New topic

Slash in action

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
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

Joined: Feb 15, 2005
Posts: 4864
"/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".

Consultant, Sima Solutions
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Slash in action
Similar Threads
Cannot retrieve mapping for action
Struts Forms ( html:form )
No action instance for path /register could be created error
Cannot find ActionMappings or ActionFormBeans collection
problem with the name attribute of form tag