|
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
|---|---|
| 作者 | 正文 |
|
时间:2008-05-06
struts2-core-2.0.8升级到struts2-core-2.0.11 发现 个 问题 。
原来这样的写法都正常 <s:if test="${not empty param.kindId}">
document.getElementById("kindId").value =${param.kindId};
</s:if>
现在 都抱错 : javax.servlet.ServletException: org.apache.jasper.JasperException: /module/basic_manage/user_show.jsp(85,5) According to TLD or attribute directive in tag file, attribute test does not accept any expressions 查了它的 tld文件发现,居然 : 一个是 :
<attribute>
<name>test</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<description><![CDATA[Expression to determine if body of tag is to be displayed]]></description>
</attribute>
另一个是 : <attribute>
<name>test</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
<description><![CDATA[Expression to determine if body of tag is to be displayed]]></description>
</attribute>
他们在搞什么啊? 不支持表达式了 。 兼容性啊! 声明:JavaEye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
|
|
| 返回顶楼 | |
|
时间:2008-05-06
是%不是$
|
|
| 返回顶楼 | |
|
时间:2008-05-07
quaff 写道 是%不是$
我 改成 <s:if test="%{not empty param.kindId}">
document.getElementById("kindId").value =${param.kindId};
</s:if>
之后 虽然不抱错了,但还是if里面的没有执行 。struts2-core-2.0.8那个版本 用 $是正常的。 |
|
| 返回顶楼 | |
|
时间:2008-05-07
请使用ognl表达式.楼主用的明显是el表达式.
用ognl的话,改成 <s:if test="%{param.kindId != null}"> 即可. |
|
| 返回顶楼 | |
|
时间:2008-05-07
myoldman 写道 请使用ognl表达式.楼主用的明显是el表达式.
用ognl的话,改成 <s:if test="%{param.kindId != null}"> 即可. btw s:if标记默认就是支持ognl的,所以 <s:if test="param.kindId != null">应该就可以了. |
|
| 返回顶楼 | |
|
时间:2008-05-08
myoldman 写道 请使用ognl表达式.楼主用的明显是el表达式.
用ognl的话,改成 <s:if test="%{param.kindId != null}"> 即可. 实不相瞒 我改成 <script type="text/javascript" xml:space="preserve">
alert("11");
<s:if test="%{param.kindId != null}">
alert("22");
document.getElementById("kindId").value =${param.kindId==null};
</s:if>
</script>
还是不行 11执行 22不执行 。 地址栏 :http://localhost:81/module/basic_manage/user_show.htm?kindId=8 |
|
| 返回顶楼 | |
|
时间:2008-05-09
奇怪了楼主我如下写法都是正常的.
<s:if test="#session['currentLoginUser'] != null" > <s:url id="successLoginUrl" namespace="/include" action="successLogin"></s:url> <iframe width="100%" height="280px" frameborder="0" id="loginFrame" src="<s:property value="successLoginUrl"/>"></iframe> </s:if> 你的kindId是int还是字符串啊? |
|
| 返回顶楼 | |
|
时间:2008-05-09
myoldman 写道 奇怪了楼主我如下写法都是正常的.
<s:if test="#session['currentLoginUser'] != null" > <s:url id="successLoginUrl" namespace="/include" action="successLogin"></s:url> <iframe width="100%" height="280px" frameborder="0" id="loginFrame" src="<s:property value="successLoginUrl"/>"></iframe> </s:if> 你的kindId是int还是字符串啊? struts小版本是多少 是 11 么? |
|
| 返回顶楼 | |
|
时间:2008-05-09
是的啊.我的版本是struts2-core-2.0.11.1.jar
|
|
| 返回顶楼 | |
|
时间:2008-05-09
myoldman 写道 是的啊.我的版本是struts2-core-2.0.11.1.jar
我又换回 08 那个版本了.我怕他了. 希望以后版本能兼容这个 08 版本 |
|
| 返回顶楼 | |






