This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft 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 Java 8 in Action this week in the Java 8 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
I agree. Here's the link:
subject: Slash in action
Similar Threads
Struts Forms ( html:form )
No action instance for path /register could be created error
problem with the name attribute of form tag
Cannot find ActionMappings or ActionFormBeans collection
Cannot retrieve mapping for action