tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karl Coleman" <>
Subject RE: counter in forEach tag?
Date Thu, 26 May 2005 17:17:35 GMT
You can use the varStatus property of the forEach tag.

<c:forEach var="asset" items="${assetCollection}" varStatus="status">

And then you can get the current count of the iteration.



-----Original Message-----
From: Scott Purcell []
Sent: Thursday, May 26, 2005 12:58 PM
Subject: counter in forEach tag?

I have this scenario come up occasionally, and have to opt to JSP expressions on the page
for a work-around.

                  <c:when test="${assetCollection == null}">
                    <c:forEach var="asset" items="${assetCollection}">


                      <c:out value="${asset.assetId}" />

In the forEach section, I am going to create a rows in a table which will be different colors
for each row. How can I put in a counter that I can then change the row color for? Basically,
I would like to know what asset I am on in the body.


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

The information contained in this transmission contains confidential  information that is
legally privileged. This information is intended only for the use of the individual or entity
named above. The authorized recipient of this information is prohibited from disclosing this
information to any other party unless required to do so by law or regulation and is required
to destroy the information after its stated need has been fulfilled.
If you are not the intended recipient, you are hereby notified that any disclosure, copying,
distribution, or action taken in reliance on the contents of these documents is strictly prohibited.
If you have received this information in error, please notify the sender immediately by return
email or phone at 800-223-9941 and arrange for the return or destruction of these documents.

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

View raw message