<% request.setAttribute("decorator", "none"); response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 response.setHeader("Pragma","no-cache"); //HTTP 1.0 response.setDateHeader ("Expires", 0); //prevents caching at the proxy server %>

set tag

The set tag sets the variable with the name specified in the name attribute to the value specified in the value attribute in the scope entered in the scope attribute. The available scopes are:

This example sets favouriteBand in the request scope to the first element of the bands property:

        <s:set name="favouriteBand" value="bands[0]" />
        <s:property value="#favouriteBand" />
    

Do it for me

url tag

The url tag is used to build urls (who would have guessed!). To build an url mapping to an action, set the namespace and action attributes. The url will be stored under the name specified in the id attribute. url tag uses the id attribute while the set tag uses name. To specify a value (no action lookup), just use the value attribute. param tags can be nested inside the url tag to add parameters to the url.

First link creates a url that maps to an action, second one creates a url to google, passing one parameter:

        <s:url id="evalAction" namespace="/nodecorate" action="jspEval" />
        <s:a href="%{#evalAction}" >Eval</s:a>
        
        <s:url id="google" value="http://www.google.com" >
            <s:param name="q" value="%{'Struts 2'}" /> 
        </s:url>
        <s:a href="%{#google}" >Eval</s:a>
    

Do it for me

[More on the set tag] [More on the url tag]