File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes url tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "url tag" Watch "url tag" New topic

url tag

deep rai
Ranch Hand

Joined: Oct 04, 2007
Posts: 56
does the below tag mean, that I am trying to use session through url rewriting

<s:url id="url" action="download"/><s:a href="%{url}">Download image file.</s:a>
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
While it is true that Struts tags involving a URL do perform URL rewriting, the main purpose of the code you've shown us is to create and use a URL for a specific action. If you're using the default suffix of ".action", the URL would translate to something like:


It's considered a better practice to use this method rather than specifying the ".action" because even though the default suffix is .action, you could set it to something else. The code you have shown us will work regardless of what the suffix is.

Consultant, Sima Solutions
I agree. Here's the link:
subject: url tag
It's not a secret anymore!