http://community.youkuaiyun.com/Expert/TopicView.asp?id=3888517
使用Struts的logic标签,遍历List时使用indeId来自动输出序号并加一
例子如下:
<table>
<tr>
<td>序号</td>
<td>姓名</td>
...
</tr>
<logic:present name="targetbean">
<logic:iterate name='helperbean' id='helperbean' type='net.echochina.HelperBean' scope='request' indexId="index">
<tr>
<td><%= index.intValue() + 1 %></td>
<td><bean:write name='helperbean' property='name' /></td>
.....
</tr>
</logic:iterate>
</logic:present>
</table>
博客给出使用Struts的logic标签遍历List的例子,通过indexId自动输出序号并加一。代码展示了在表格中,利用logic标签和bean标签,实现序号与姓名等信息的输出。

被折叠的 条评论
为什么被折叠?



