File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "url tag" Watch "url tag" New topic
Author

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:

"http://myserver.com/myApp/action.action"

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.


Merrill
Consultant, Sima Solutions
 
jQuery in Action, 2nd edition
 
subject: url tag
 
Similar Threads
Struts 2: Iterating through Alphabetized Map
Pass parameters to Model from anchor tag
Url does not have the querystring on using the <s: tags in struts2
struts 2 tags question, certain jsp code not being executed
struts 2 example to have a link in one of the Iterated value in the JSP and pass it to an action