Is it possible to access JSTL's forEach variable via code from within the loop?
<c:forEach items="${elements}" var="element">
    <% element.someMethod(); %>
</c:forEach>
                Well, I believe "element" is stored in the page context.
<c:forEach items="${elements}" var="element">
    <% ((Element) pageContext.getAttribute("elements")).someMethod(); %>
</c:forEach>
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With