tags:

views:

350

answers:

1
<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>

How to iterate the above table? I read that only collections can be iterated. But I am also using "checkbox" inside the <td>. How to do?

A: 

If you want to display single table has multiple tables by iteration

You can use any JSTL or Struts tag iterator to iterate a table

For Example

<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>
Vinayak.B
thanks for the response.. but i am using struts1. what is the syntax for that.
Niru...
YOu can use the same as above just add <%@ taglib uri="/struts-tags" prefix="s" %> taglib to your jsp OR You can use JSTL core TAG <c:forEach var="listObject" items="$listObject"></c:foreach>
Vinayak.B