Hi Thanks for your help. I want to get rid of <% if ( ((idx.intValue())%2) == 0 ) { %> <tr class="evenrow"> <% } else { %> <tr class="oddrow"> <% } %> and replace it with 'evenStyleClass' and 'oddStyleClass' MJ
Meenakshi j wrote: > Hello, > I am new to struts and would like to change the code below > <logic:iterate indexId="idx" id="director" name="ProposalSummaryForm" > property="directors"> > <% if ( ((idx.intValue())%2) == 0 ) { %> > <tr class="evenrow"> > <% } else { %> > <tr class="oddrow"> > <% } %> > </logic:iterate> > to style class row tags. I am not sure how to do this. Any help > would be appreciated. You'd like to change the code how? Does what you have here not work? Or do you mean you want to get rid of the run-time expressions? If the latter, you may want to consider using JSTL. Something roughly like this may do the trick: <c:forEach var="director" varStatus="status" items="ProposalSummaryForm.directors"/> <tr class="${status.index % 2 == 0 ? 'evenrow' : 'oddrow'}"> .... </tr> </c:forEach> L. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com