您的位置:首页 > 运维架构

注意在<s:if test="#session.user.power==0">中不能用 <s:if test=$sessionScope.user.power==0">

2012-04-25 20:10 477 查看
获取封装在session的对象

用#session.对象名,可以获取对象

用#session.对象名.属性,可以获取属性。

注意在<s:iftest="#session.user.power==0">中不能用

<s:if test=$sessionScope.user.power==0">

具体解释:

错误提示如下:

2008-3-12 10:53:13 org.apache.catalina.core.StandardWrapperValve invoke

严重: Servlet.service() forservlet jsp threw exception

org.apache.jasper.JasperException: /taglib/ifelse.jsp(17,2)According to TLD orattribute directive in tag file, attribute test does not accept any expressions

经查找发现解决办法如下
错误提示是,该标签不能接受el表达式

struts2.0标签主要支持的是ognl表达式

所以把<s:elseiftest="${age > 35}">

改为<s:elseiftest="#age>35">

就ok了

还有人说
struts2 _2.0.11 版本不支持 s 标签嵌套 EL

struts2_2.0.08 这个支持但是不支持集合封装pojo。。。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐