JSTL跳出forEach循環
<c:forEach items="${list2.classifyList}" var="list3"> //最外面循環
<c:set var="isDoing" value="0"/> //在裏面循環外賦值
<c:forEach items="${spcList}" var="spcList" varStatus="i" > //第二層循環
<c:if test="${spcList.classifyid==list3.serialnumber}"> //判斷相等後根據ID顯示名稱
<input type="checkbox" name="classify" value="${list3.serialnumber}" checked>${list3.name}
<c:set var="isDoing" value="1"/> //賦值跳出循環
</c:if>
</c:forEach>
<c:if test="${isDoing!='1'}"> //如果等於賦的值顯示最外面循環內容
<input type="checkbox" name="classify" value="${list3.serialnumber}">${list3.name}
</c:if>
</c:forEach>