프로그래밍/JSTL & EL
[JSTL] if ~ else 문 사용 방법
Dondons
2018. 4. 7. 16:47
단순 if 문 <c:if>
<c:if test="${newArrival.pbYN eq 'Y'}">
<span> 당일 </span>
</c:if>
if ~ else 문 <c:choose>
<c:choose>
<!-- memberLikeList가 비어있을 때 -->
<c:when test="${!empty requestScope.memberLikeList}">
<!-- 빈 하트 출력 -->
<li><a class="fa fa-heart-o" id="heart"></a></li>
</c:when>
<c:otherwise>
<!-- 꽉 찬 하트 출력 -->
<li><a class="fa fa-heart" id="heart"></a></li>
</c:otherwise>
</c:choose>