천재 블로그

[JSTL] if ~ else 문 사용 방법 본문

프로그래밍/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>


'프로그래밍 > JSTL & EL' 카테고리의 다른 글

[JSTL] For문 Break  (0) 2018.04.09
[JSTL] 비교연산 eq, ne, empty  (0) 2018.04.08
[JSTL] 숫자 Format, 가격 표기하기  (0) 2018.04.03
Comments