11:<s:property value='#attr.jxwReadyOnly'/>
22:<s:property value='#attr.jxwReadyOnly=="jxwReadyOnly"'/>
33:<s:property value='#session.get("jxwReadyOnly")=="jxwReadyOnly"'/>
44:<s:property value="#session.jxwReadyOnly=='jxwReadyOnly2'"/>
55:<s:property value='%{#session.jxwReadyOnly=="2jxwReadyOnly"}'/>
输出:11:jxwReadyOnly 22:true 33:true 44:false 55:fasle
总结:
1、单引号里用双引号,双引号里就用单引号
2、#session.get("jxwReadyOnly") 和#session.jxwReadyOnly 都可以取值
3、可用attr
4、引号里可以直接跟#号,而不用%{},当然加上%{}不会出错
<s:if test='%{#session.jxwReadyOnly=="jxwReadyOnly"}'>
和<s:if test='#session.jxwReadyOnly=="jxwReadyOnly"'> 都可以
标签:11,22,标签,44,struts2,session,jxwReadyOnly,字符串,true
From: https://blog.51cto.com/u_16200746/6803361