If I'm in the rwong newsgroup, please point me where to post
I'm plunging into the world of JSP development and I'm
wanting to improve on this type of [messy] logic:
<% int rowCount = 0; %>
<logic:iterate id="oi" name="myForm" property="stuff">
<% if (++rowCount % 2 == 0) { %>
<tr class=normalRow>
<% } else { %>
<tr class=altRow>
<% } %>
<td><bean:write name="oi" property="group3Name" /></td>
</tr>
</logic:iterate>
My attempts have been various incarnations (for the <tr>) of the
following, utilizing iterate's -indexId-:
<logic:notEmpty name="myForm" property="stuff">
<logic:iterate id="oi" name="myForm" property="stuff" indexId="index">
<tr class=<% (index.intValue()%2==0) ? "altRow" : "normalRow"; %>" >
<td><bean:write name="oi" property="group3Name" /></td>
</tr>
</logic:iterate>
Unfortunately, we arent using JSTL (and wont be), otherwise I
could use this fix:
http://cephas.net/blog/2004/02/25/js...ts_taglib.html
Any suggestions for improvement ?