tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <>
Subject No "index" var in "forEach" tag?
Date Wed, 07 Aug 2002 18:22:08 GMT
Unless I'm missing something obvious, there doesn't appear to be an "index"
attribute in the "forEach" tag, which would specify a var to hold the
current loop index.

This could have many uses, but probably a common one might be something like
this (I hope I have my syntax correct):

 <c:forEach var="item" items="collection" index="index">
  <tr class="${styleClass[index mod 2]}">

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message