File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
It's not a secret anymore!