如何使用Struts标签在JSP中迭代表?

时间:2010-02-03 12:26:45

标签: java struts2

<table border="0" cellspacing="1" cellpadding="0" width="100%" class="boxtbl">
  <th rowspan="2" class="fntnrml" colspan="5">Trip ID</th>
  <bean:write name="loan" property="tripID1" /> 
  <td><html:checkbox property="ZAXY" /></td>
  <td><bean:write name="loan" property="Profile11" /></td>
  <td><bean:write name="loan" property="StartDt11" /></td>
</table>

如何迭代上表?我读到只有集合可以迭代。但我也在<td>内使用“复选框”。怎么办?

1 个答案:

答案 0 :(得分:0)

如果要通过迭代显示单个表有多个表

您可以使用任何JSTL或Struts标记迭代器来迭代表

例如

<s:iterator value="listObject">
<table border="0" cellspacing="1" cellpadding="0" width="100%" class="boxtbl">
  <th rowspan="2" class="fntnrml" colspan="5">Trip ID</th>
  <bean:write name="loan" property="tripID1" /> 
  <td><html:checkbox property="ZAXY" /></td>
  <td><bean:write name="loan" property="Profile11" /></td>
  <td><bean:write name="loan" property="StartDt11" /></td>
</table>
</s:iterate>