I am using the following expression on my jsp
<c:set var="flag" value="false" />
I have a condition inside a for each loop where I might want to change this variable to true. Is there a way to do this. I've looked everywhere but unable to find a solution.
Here is the sample code you are looking for:
<c:choose>
<c:when test="${yourcondition}">
<c:set var="flag" value="true" />
</c:when>
<c:otherwise>
<c:set var="flag" value="false" />
</c:otherwise>
</c:choose>
why dont you just reuse the same code within your loop
<c:set var="flag" value="true" />
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