tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <david.k...@attws.com>
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]}">
   ...
  </tr>
 </c:forEach>

--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>


Mime
View raw message