자바 웹 개발자가 될거야/JSP
[JSTL/EL] core_choose
whitz
2022. 1. 13. 15:35
< core_choose >
- switch case문 역할이라하지만 if elseif 느낌이 더 강함
- when test : case의 조건문을 의미
- otherwise : default 의미
<c:set var="num1" value="100"/>
<c:set var="num2" value="200"/>
<c:choose>
<c:when test="${num1 > num2} ">
num1 더 크다 <br>
</c:when>
<c:when test="${num1 < num2} ">
num2 더 크다 <br>
</c:when>
<c:otherwise>
그외 나머지 상황<br>
</c:otherwise>
</c:choose>