You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jana Navaneethan <ja...@labs.gte.com> on 2002/12/05 16:57:52 UTC

Collection iterate question!

Hi ,
        I have a collection in my JSP, I want to iterate this collection and
display even rows only. Is there a way to do this?
Any help would be greatly appreciated!

Thanks in advance,
Jana.

<%
  java.util.ArrayList paymentListOdd = new java.util.ArrayList();
  paymentListOdd.add("American Express");
  paymentListOdd.add("Credit Terms Available");
  paymentListOdd.add("Diner's Club");
  paymentListOdd.add("Mastercard");
  paymentListOdd.add("Financing Available");
  paymentListOdd.add("Traveler's Check");
  pageContext.setAttribute("paymentListOdd", paymentListOdd,
PageContext.PAGE_SCOPE);
%>

<logic:iterate id="OddLabel" name="paymentListOdd">
     <tr>
            <td width="120">&nbsp;</td>
      <td width="230" valign="top"> <b><font face="Arial, Helvetica,
sans-serif" size="2">
      <html:multibox property="paymentOptions"><bean:write
name="OddLabel"/></html:multibox>&nbsp;<bean:write
name="OddLabel"/></font></b></td>
</logic:iterate>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>