JSTL에서 IF문을 사용하는 방법입니다.
IF ELSE 는 지원하지 않아서 choose를 사용해야 합니다.
if 문
<c:if test="${billPaymentResult.holidayYn eq 'Y'}">
<font color="red">${billPaymentResult.week}</font>
</c:if>
if else 문
<c:choose>
<c:when test="${billPaymentResult.holidayYn eq 'Y'}">
<font color="red">${billPaymentResult.week}</font>
</c:when>
<c:otherwise>
${billPaymentResult.week}
</c:otherwise>
</c:choose>
비교기호는 아래와 같습니다.
eq (==) : 동일하다면 참
ne (!=) : 다르다면 참
empty (==null) : 값이 비어있다면 참
not empty (!=null) : 값이 있다면 참
| JSTL 리스트 특정위치 추출하기 (LIST INDEX) (0) | 2023.02.09 |
|---|---|
| JSTL List size, forEach 리스트 출력 (if, choose 적용) (0) | 2016.09.05 |
| JSTL 날짜표현 (패턴, 포멧) (0) | 2016.05.11 |
댓글 영역