<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="변수명" value="${param.name명}" />
// === parameter.name === //
// === request의 get 과 동일한 역할 === //
String 변수명 = request.getParameter("name명");
<c:if test="${param.name명 eq param.name명}">
...
</c:if>
<c:if test="${param.name명 ne param.name명"}">
...
</c:if>
// eq : 같다 / ne : 같지 않다
////////////////////////////////////////////////////////////////
<c:if test"${empty param.name명}">
...
</c:if>
<c:if test"${not empty param.name명}">
...
</c:if>
<c:if test="${!empty param.name명}">
...
</c:if>
// empty : 공백 // not empty, !empty : 공백이 아닌 경우
<c:choose>
<c:when test="${변수명 eq '값' or 변수명 eq '값'}">
... // if 문
</c:when>
<c:when test="${조건}">
... // else if 문
</c:when>
<c:otherwise>
... // else 문
</c:otherwise>
</c:choose>
데이터가 배열 또는 리스트
begin ~ end
<c:forEach var="i" begin="숫자" end="숫자">
... ${i}
</c:forEach>
<c:forEach var="변수명" items="${requestScope.배열변수명}">
// ' items = "${ }" ' 에 들어오는 것은 배열 또는 List
// 반복횟수는 배열길이 또는 List 의 size 만큼 반복
... ${변수명.name명}
</c:forEach>
<c:forEach var="변수명" items="${requestScope.배열변수명}"
varStatus="status">
${status.index} // 0 부터 시작
${status.count} // 1 부터 시작
... ${변수명.name명} // name 명 소문자
</c:forEach>
<c:forTokens var="변수명" items="${requestScope.변수명1}"
delims="구분자">
// 배열이나 List 가 아닌 하나의 문자열
// delims="," 이라면 , 로 잘라서 배열로 만들어준다.
// 구분자가 여러개라면 delims=",./" => , 또는 . 또는 / 로 자르기
JSPServlet -> src~webapp -> chap04_JSTL -> 01_set
-> multiply_execute_01.jsp, multiply_result_02.jsp, 01.js
JSPServlet -> src~webapp -> chap04_JSTL -> 02_if
-> if_execute_01.jsp, if_result_02.jsp, 01.js
JSPServlet -> src~webapp -> chap04_JSTL -> 03_choose
-> choose_execute_01.jsp, choose_result_02.jsp, 01.js
JSPServlet -> src~webapp -> chap04_JSTL -> 04_forEach
-> 01_forEach_execute.jsp, 02_forEach_execute_01.jsp, 02_forEach_Array_List_result_02.jsp
JSPServlet -> src~webapp -> chap04_JSTL -> 05_forTokens
-> forTokens_execute_01.jsp, forTokens_result_02.jsp