Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Iterating using forEach c:out over an arrayList - printing size()

843836Apr 14 2005 — edited Apr 14 2005
Hi all

I am iterating over a collecton of objects inherited from ArrayList and I need to be able to emit the size of each array list over which I'mn iterating... I tried this but of course there is no explicit "size" attribute on my object.

do I have to artificially create a "totalObjects" attribute or something with a getter and setter so I can do this:

<c:forEach var="portfolio" items="${userPortfolios}">
Size of current object=<c:out value="${portfolio.totalObjects}"/>
</c:forEach>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 12 2005
Added on Apr 14 2005
1 comment
213 views