用struts2标签循环显示list内容,
首次进入很正常,但是添加过一条信息之后,在次进入页面时,就不遍历该list了
用debug追查代码的时候发现list还在,
用firebug查看页面的时候,发现页面用iterator标签不见了,
大神们路过看下

解决方案 »

  1.   

    是不是添加之后回到那个页面没有再次去查询?导致list中没值?
      

  2.   

    你在页面看源码iterator还会存在?
      

  3.   

    追过了,list中值还在,页面源代码iterator不在了
      

  4.   


     <s:iterator value="originalPropList" status="num">
                  <TR>
                   <TD class="STYLE6"  bgColor="#ffffff" height="20"><DIV align=center><SPAN class=STYLE19>
                   <s:property value="1"/></SPAN></DIV></TD>
                    <TD class="STYLE6"  bgColor="#ffffff" height="20"><DIV align=center><SPAN class=STYLE19><s:property value="websiteName"/>(<s:property value="websiteID"/>)</SPAN></DIV></TD>
                    <TD class="STYLE6"  bgColor="#ffffff" height="20"><DIV align=center><SPAN class=STYLE19><s:property value="originalID"/></SPAN></DIV></TD>
                    <TD class="STYLE6"  bgColor="#ffffff" height="20"><DIV align=center><SPAN class=STYLE19><s:property value="pName"/>(<s:property value="pid"/>)</SPAN></DIV></TD>
                    <TD class="STYLE6"  bgColor="#ffffff" height="20"><DIV align=center><SPAN class=STYLE19><s:property value="name"/></SPAN></DIV></TD>
                    <TD class="STYLE6"  bgColor="#ffffff" height="20"><DIV align=center><SPAN class=STYLE19><s:property value="odesc"/></SPAN></DIV></TD>
                    <TD class="STYLE6"  bgColor="#ffffff" height="20"><DIV align=center>
                    <a onclick="return confirm('确定要注销吗?')" href="<s:url action="cancleOriginalProp.action">
                     <s:param name="originalProp.opid" value="opid" />
                     <s:param name="cpc.productCategoryID" value="cpc.productCategoryID" />
    <s:param value="prop.pid" name="prop.pid"></s:param>
                    </s:url>" target="content3">注销</a>
                    <a onclick="return confirm('确定要删除吗?')" href="<s:url action="deleteOriginalProp.action">
                     <s:param name="originalProp.opid" value="opid" />
                     <s:param name="cpc.productCategoryID" value="cpc.productCategoryID" />
                     <s:param value="prop.pid" name="prop.pid"></s:param>
                    </s:url>" target="content3">删除</a>
                    </DIV></TD>
                  </TR>  </s:iterator> 
    这是页面的iterator
    在进行任何action之后,这个iterator就消失了,首次很正常
      

  5.   

     页面debug list值还在吗?
      

  6.   

    firebug查看页面的时候,iterator标签 消失是必然的。一个是服务端,一个是客户端
    在进行任何action之后,这个iterator就消失了,首次很正常 , 这个描述比较不明白
      

  7.   

    你试试,你插入一条记录后,跳转到查询list的action
      

  8.   

    出现的问题原因是action的单体和多例,单例情况,所有action共用参数,多例,每个action用各自的参数,问题出现在,我之前用单例,共用参数造成数据混乱,所以不显示