foreach控制循环if判断
<c:forEach items="${resultMap}" var="daily" varStatus="n"> <tr class="<c:choose><c:when test="${n.index % 2==0 }">row-even</c:when><c:otherwise>row-odd</c:otherwise></c:choose>"> <td> ${chMap[daily.key]} </td> <c:forEach items="${headData}" var="hdata"> <c:set var="endFlag" value="1"/> <c:forEach items="${daily.value}" var="order" varStatus="st"> <c:if test="${hdata==order.productName}"> <td> ${order.orderNum} </td> <td> <fmt:formatNumber value="${order.allPayAmount/100 }" pattern="0.00"/> </td> <c:set var="endFlag" value="2"></c:set> </c:if> <c:if test="${(st.index+1)==fn:length(daily.value) && endFlag!=2}"> <td> 0 </td> <td> 0.00 </td> </c:if> </c:forEach> </c:forEach> </c:forEach>
愿你眼中有光芒,活成你想要的模样