您可以使用<c:set />
.
<c:if test="${empty block}">
<c:set var="block" value="0" scope="session"/>
</c:if>
<c:choose>
<c:when test="${block ge 0}">
....
</c:when>
<c:otherwise>
.....
</c:otherwise>
</c:choose>
<c:set var="block" scope="session" value="${block-1}"/>