注意在<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。。。。
用#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。。。。
相关文章推荐
- <s:if test="canSubscribe == 'Y'">能 </s:if> <s:else>不能 </s:else> 单字符需加.toString()
- <s:if test="canSubscribe == 'Y'">能 </s:if> <s:else>不能 </s:else> 单字符需加.toString()
- <c:if test="${fn:contains(name, searchString)}">
- <c:if test="${empty(*)}"> 报错javax.el.ELException: Function ':empty' not found;
- <c:if test="value ne, eq, lt, gt,...."> 用法
- <c:if test="value ne, eq, lt, gt,...."> 用法
- <c:if test="value ne, eq, lt, gt,...."> 用法
- <c:if test="value ne, eq, lt, gt,...."> 用法
- struts2 国际化 <s:if test="%{#session.WW_TRANS_I18N_LOCALE.toString()=='zh_CN'}">
- <c:if test="">多条件判断
- jstl 的if else <c:choose><c:when test="">如果</c:when><c:otherwise>否则</c:otherwise></c:choose>
- Mybatis-Generator生成Mapper文件中<if test="criteria.valid">的问题解答
- jstl select <c:if test下拉菜单不能被选中!
- mybatis <if test=""></if>标签0为null
- <c:if test="value ne, eq, lt, gt,...."> 用法
- 【<if test="takeWay == '0'">】mybatis的if判断有坑
- 开发日志:使用struts2标签[<s:if><s:property>等]获取boolean属性需注意
- <c:if>标签中的test可以比较两个el表达式中的值
- <c:if test="></c:if>判断字符串的长度并部分显示
- mybatis映射文件中不能使用">""<""&"问题