Struts 2 set tag: defines a variable

Example

<body>
  <!--将表达式user.username的值保存在默认范围中,即action范围-->
  <s:set name="name" value="user.username"/>
  <h4>从默认的action上下文中取出name</h4>
  <s:property value="#name"/>
  <!--将表达式user.username的值保存到session范围中-->
  <s:set name="name" value="user.username" scope="session"/>
  <h4>设定了Session范围中的值并从session范围中取出name</h4>
  <s:property value="#session.name"/>
</body>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>