struts2标签获取parameter,request,session,application中的值

request.----> 

<s:property value="#request.mySessionPropKey"/> or  

<s:property value="#request['mySessionPropKey']"/> or  

<s:property value="#request['myRequestPropKey']"/> or

${requestScope.buttonRoleMap}  or

${request.buttonRoleMap}  or

${buttonRoleMap} 



session----> 

<s:property value="#session.mySessionPropKey"/> or  

<s:property value="#session['mySessionPropKey']"/> or  

<s:property value="#session['myRequestPropKey']"/> or

${session.buttonRoleMap}



application---> 

<s:property value="#application.mySessionPropKey"/> or  

<s:property value="#application['mySessionPropKey']"/> or  

<s:property value="#application['myRequestPropKey']"/> or

${application.buttonRoleMap}



这里用到了ognl表达式,不懂的可以参考下面网站。但是英文的,不过没有关系我们看那些关键的代码就可以。
其实的英语也是很菜的,但一般也会到一些英文的网站找资料。关键的是我要看的一些关键字和代码 。
参数资料:http://struts.apache.org/2.1.6/docs/ognl.html

转自:http://blog.csdn.net/coffeeing/article/details/5620367

posted on 2015-03-17 10:14  Msea  阅读(118)  评论(0编辑  收藏  举报

导航