1) form 제출 (GET/POST)
2) a 태그 (GET)
3) JS - location.href = "주소"; (GET)
4) JS - Ajax 비동기 요청 (GET/POST/PUT/DELETE)
특징
작성법
<%= request.getParameter("name") %>
정의
특징
작성법
${param.name}
${paramValues.name}
${paramValues.name[0]} ${paramValues.name[1]}
${param.doubleNum == 3.14}
정의
라이브러리 추가 방법
1. 필요한 라이브러리(.jar) 파일 다운
2. 프로젝트 webapp/WEB-INF/lib 폴더에 복붙
3. JSTL을 사용할 JSP 파일 제일 위에 taglib 추가 구문 작성
<%-- prefix : 접두사 (앞에 붙는 단어) --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:if test="${param.age >= 20}">
<h3>성인입니다(JSTL 사용)</h3>
</c:if>
종류
정의
종류
1. page scope
<%
// page scope 객체에 값 세팅
pageContext.setAttribute("키", 값);
%>
<%= pageContext.getAttribute("키") %>
req.setAttribute("키", 값);
req.getAttribute("키");
// 1) sseion scope 객체 얻어오기
HttpSession session = req.getSession();
session.setAttribute("키", 값);
session.getAttribute("키");
ServletContext application = req.getServletContext();
application.setAttribute("키", 값);
application.getAttribute("키");