My last time I did Struts was early this year, so let me explain with best knowledge,
There is no way of determining the length of the collections by using logic:iterate
(See explanation here). What you will have to do is the following:
Assuming your collections is placed under request.setAttribute("collections", allMyCollections);
You can use EL
(Expression Language) to determine the size and determine if they are equal by using c:if
, i.e. in this effect:
<logic:iterate name="collections" id="curElement">
<c:if test="${curElement.indexId == ${fn:length(collections) - 1}}">
<!-- It is pretty messy ...but you get the idea -->
<!-- We are the last element...whoohoo!!! -->
</c:if>
</logic:iterate>
Otherwise, use <bean:size />
to get the size of the collections, set it to a variable and you'll use scriplets to get the stored collections size and use <logic:equal>
tags to see if the last index is at collections.size() -1
(but that's cumbersome).
Hope this helps.
PS The code is rough....