\ 참조 /
scope
변수 저장소 (범위)
default 값 (scope를 적지 않을때) 은 page 일것이다.
scope=" 여기 " | 설명 |
page | 현재 페이지(view)만 사용가능 |
request | request 범위까지 |
session | 다른 페이지(view)에서도 가능 |
application | 전체 프로그램 |
★
import
< c Library 사용하겠다 >
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
c:import
공통 페이지 끼워 넣기 : 머리말 , 꼬리말 등
<c:import url="보여줄 페이지"/>
// 또는
<c:import url="보여줄 페이지" [var="변수명"]> [<c:param>] </c:import>
c:url
url을 만드는 기능을 수행
<c:url value="url" [var="변수명"] [scope=""] charEncoding="UTF-8>
// 예시
<c:url value="http://www.naver.com" var="naver"/>
<h2><a href="${naver}">네이버</a> </h2>
c:redirect
페이지 강제 이동
<c:redirect url="이동할_url주소"/>
c:out
value 값 출력
<c:out value=""/>
c:set
변수에 값을 저장
<c:set var="변수이름" value="값" [scope=""]/>
c:remove
변수가 더이상 필요하지 않으면 제거
<c:remove var="변수명" [scope=""]/>
c:if
( 단항 if )
https://tinylittlelife.tistory.com/196
<c:if test="조건식">
true 실행문
</c:if>
c:when
( if ~ else if ~ else )
https://tinylittlelife.tistory.com/196
<c:choose>
<c:when test="${ 조건식 }"> // if
true 실행문
</c:when>
<c:when test="${ 조건식 }"> // else if
true 실행문
</c:when>
<c:otherwise> // else
default 실행문
</c:otherwise>
</c:choose>
c:foreach
반복문
https://tinylittlelife.tistory.com/195
<c:forEach var="일반변수" items="${배열}"> // EL 구문 사용
<p>${일반변수}</p> // EL 구문 사용
</c:forEach>
c:forTokens
문자열을 구분하여 전체 출력함
https://tinylittlelife.tistory.com/201
<c:forTokens items="문자열" delims="구분자" var="변수명">
</c:forTokens>
c:catch
예외 처리
https://tinylittlelife.tistory.com/202
<c:catch var="에러변수">
실행문
</c:catch>
'SpringBoot > JSP (참조)' 카테고리의 다른 글
Jsp - JSTL - fmt Library (1) | 2023.10.06 |
---|---|
Jsp - JSTL - fn Library (0) | 2023.10.06 |
Jsp - JSTL - try ~ catch (0) | 2023.10.06 |
Jsp - JSTL - forToken (0) | 2023.10.06 |
JSP - 조건문 (1) | 2023.10.05 |