首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

Struts2的iterator跟if

2012-12-28 
Struts2的iterator和ifs:iterator value#coll.result statusxs:property value#x.count/----

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">
换成这样试试看呢,我写的时候没用过标签嵌套
[其他解释]
不过楼主的结帖率也是够让人蛋疼的
[其他解释]

引用:
不过楼主的结帖率也是够让人蛋疼的

不是我结帖率蛋疼,你可以去看下我发的三个帖子,要么没人回答,要么回答得乱七八糟的,最后搞得我自己都不知道自己在问什么。
[其他解释]
引用:
<s:if test="<s:property value='#x.count'/>==1">
已经有struts2的标签了可以直接使用ognl没必要再加入<s:property/>标签
改成
<s:if test="#x.count==1">


这个还真行,谢谢了哈,其实我还有个问题,要不你也一并开导了我?去看我令一个帖子,就是关于一个显示在页面的方法,注意是要用表格的。

热点排行