Struts2的iterator和if
<s:iterator value="#coll.result" status="x">
<s:property value='#x.count'/>------这里页面上显示出来为123456,我数据库也是6条记录。
<s:if test="<s:property value='#x.count'/>==1">
<tr>
<td>aaaaaaaa</td>------为什么这里的aaaaaaa没显示出来?
</tr>
</s:if>
</s:iterator>
想问一下,是我的if标签里面的条件写错了还是有什么其它的原因?非常的郁闷,求大虾解决。
[最优解释]
<s:if test="<s:property value='#x.count'/>==1">
已经有struts2的标签了可以直接使用ognl没必要再加入<s:property/>标签
改成
<s:if test="#x.count==1">
[其他解释]
<s:if test'#x.count'==1">
换成这样试试看呢,我写的时候没用过标签嵌套
[其他解释]
不过楼主的结帖率也是够让人蛋疼的
[其他解释]