<c:choose>
<c:when test="${!empty user.regions}">
<c:forEach var="r" items="${reList}">
<c:set var="flag" value="false" scope="page"/>
<c:forEach var="urs" items="${user.regions}">
<c:choose>
<c:when test="${r.regionId == urs.regionId }">
<c:set var="flag" value="true"/>
</c:when>
</c:choose>
</c:forEach>
<c:choose>
<c:when test="${flag}">
<li><input type="checkbox" value="${r.regionId }" checked="checked" /><span>${r.regionName }</span></li>
</c:when>
<c:otherwise>
<li><input type="checkbox" value="${r.regionId }" /><span>${r.regionName }</span></li>
</c:otherwise>
</c:choose>
</c:forEach>
</c:when>
<c:otherwise>
<c:forEach var="r" items="${reList}">
<li><input type="checkbox" value="${r.regionId }" /><span>${r.regionName }</span></li>
</c:forEach>
</c:otherwise>
</c:choose>
JSP之EL表达式-集合之间的遍历匹配
最新推荐文章于 2019-07-27 15:15:09 发布