<% 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 %>

String Attributes

Some tag attributes are expected to be Strings in which case String literals can be passed as the value, like the href attribute in the a tag.

<s:a href="http://struts.apache.org/" />

If the value that you want to use in one of these string literal attributes is stored on the Value Stack, then the %{#name} syntax (alternative syntax) needs to be used. Assuming there is a value with the name "url" stored on the stack:

<s:a href="%{#url}" />

will create an anchor and use the value of "url" for the href attribute.

Value Attributes

Other attributes expect an object as their value(not an string literal). In these attributes you can specify the name of a variable stored on the Value Stack, and the tag will look it up and use it. Like the value attribute in the property tag. Assuming there is an object stored on the Value Stack with the name "movie", then:

<s:property value="movie" />

will print the value to the page. To pass an String literal to an attribute that expects a value use the %{'string'} notation.

If you don't remember if an attribute expects an string literal or a value, you can always use the %{value} notation:

<s:a href="%{'http://struts.apache.org/'}" />
<s:property value="%{#movie}" />

[More details]