解決JSTL標(biāo)簽 循環(huán) 中途 break
如果直接使用<c:forEach> 直接在中間的代碼中 插入break , 并不能退出循環(huán)。可以采用以下策略進行代換:
1. 用 <c:set var="collections" value="${forEach中的items}"/>
2. 用 jspContext.getAttribute("collections"); 獲得對應(yīng)的集合
3.最后就用最原始的for()。
1. 用 <c:set var="collections" value="${forEach中的items}"/>
2. 用 jspContext.getAttribute("collections"); 獲得對應(yīng)的集合
3.最后就用最原始的for()。
posted on 2008-07-14 14:19 cong 閱讀(1832) 評論(1) 編輯 收藏 所屬分類: JSP