我想這一點,但它要else部分總是JSP MOD操作不工作
<c:forEach items="${records}" var="field" varStatus="counter">
<c:choose>
<c:when test="${counter.count mod 2 == 0}">
<div class="classEven">
</c:when>
<c:otherwise>
<div class="classOdd">
</c:otherwise>
</c:choose>
sample text here
</div>
</c:forEach>
這有什麼錯呢?
你試過用'$ {(counter.count模2)== 0}'? – 2012-02-03 12:05:46
是的,它的工作現在..謝謝JB – user965884 2012-02-03 12:16:20