Cannot create iterator for this collection解决方法:
<%--用户管理 --%>
<div class= "menu_head " id= "menu1 " >
<a class= "on " id= "menu1_a " tabindex= "1 " onclick= "onoff(this);return false " onkeypress= "onoff(this) "> 用户管理 </a> </div>
<div class= "menu_box " id= "menu1_child ">
<table>
<logic:present name= "result ">
<logic:iterate id= "result " name= "result ">
<tr>
<logic:equal name= "result " property= "pertain_to " value= "a ">
<td> <a href= " <bean:write name= "result " property= "phref " /> "> <bean:write name= "result " property= "pname "/> </td>
</logic:equal>
<logic:notEqual name= "result " property= "pertain_to " value= "a ">
<td> </td>
</logic:notEqual>
</tr>
</logic:iterate>
</logic:present>
</table>
</div>
<%--资料管理 --%>
<div class= "menu_head " id= "menu2 " >
<a class= "on " id= "menu2_a " tabindex= "2 " onclick= "onoff(this);return false " onkeypress= "onoff(this) "> 资料管理 </a> </div>
<div class= "menu_box " id= "menu2_child ">
<table>
<logic:present name= "result ">
<logic:iterate id= "result " name= "result ">
<tr>
<logic:equal name= "result " property= "pertain_to " value= "b ">
<td> <a href= " <bean:write name= "result " property= "phref " /> "> <bean:write name= "result " property= "pname "/> </a> </td>
</logic:equal>
<logic:notEqual name= "result " property= "pertain_to " value= "b ">
<td> </td>
</logic:notEqual>
</tr>
</logic:iterate>
</logic:present>
</table>
</div>
result有以下数据
phref pname pertain_to
updatePassword.jsp 修改密码 a
employee.do?method=init 编辑员工信息 b
我的想法是当pertain_to为a的时候就就显示修改密码
为b的时候就显示编辑员工信息
如果我是在一个table里面判断的话,就没有问题,为什么我写在
多个table里面就有问题?
------解决方法--------------------------------------------------------
你把result放到什么容器里啦?
应该是容器不支持logic:iterate
------解决方法--------------------------------------------------------
请检查你是否设置了延迟加载,如果设置了延迟加载在JSP页面中session已经关闭是不可能取到东西的
------解决方法--------------------------------------------------------
你可以传两个list
分别放不同的
这样不容易出错