This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: url tag