Struts2 set Tag (data tag)

Usage:
set tag allow user to store value at any specific scope or at ActionContext.
Its proper use case is, if you need a deep OGNL expression for locating any value in the framework. Then you can store that particular value in your desired scope with a meaningful short name.

Attributes:
name: It is required. Its type is String. It is a reference name for the variable to be stored into any specified scope.

scope: Its type is String. It is not mandatory. It should be any valid scope name.

value: Its type is object. It will be expression of the value you want to store.

Example:
<s:set name="username" value="user.username"/>
UserName: <s:property value="#username"/>

Here we have used #username in the property tag because by default the username will be stored into the ActionContext at the level of  ValueStack, session map etc

<s:set name="username" scope="application" value="user.username"/>
UserName: <s:property value="#application['username']"/>

Her we have stored the username into application scope. So to display the same from application we used the #application syntax.