Iterating using forEach c:out over an arrayList - printing size()
843836Apr 14 2005 — edited Apr 14 2005Hi 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>