jsp通过logic:iterate循环显示action中传过来的对象List只显示一条记录,为什么?

来源:百度知道 编辑:UC知道 时间:2024/09/23 22:39:24
<logic:iterate id="cchz" name="result" >

<tr>
<td><bean:write name="cchz" property="cc" /></td>
<td><bean:write name="cchz" property="lx" /></td>
<td><bean:write name="cchz" property="cfz" /></td>
<td><bean:write name="cchz" property="kcsj" /></td>
<td><bean:write name="cchz" property="ddz" /></td>
<td><bean:write name="cchz" property="ddsj" /></td>
<td><bean:write name="cchz" property="ys" /></td>
<td><bean:write name="cchz" property="lc"

你的form里面property的字段都加了吗 ,看这几行代码没有发现错误

java类的代码:

request.setAttribute("list",xxxList)或者request.getSession().setAttribute("list",xxxList);

到jsp页面是:

<logic:NotEmpty name="list" >
<logic:iterate name="list" id = "ls">
<tr>
<td><bean:write name="ls" property="name"/> </td>
<td><bean:write name="ls" property="no"/> </td>
<td><bean:write name="ls" property="sex"/> </td>
</tr>
</logic:iterate>
</logic NotEmpty>