728x90
반응형
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%-- src/main/webapp/ch06/pageContext1.jsp --%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h2>psgeContext 객체 : 현재 페이지의 자원을 관리하는 객체 : page 영역을 담당</h2>
<% if(request == pageContext.getRequest()) { //같은 객체임.%>
request 객체와 pageContext.getRequest()가 리턴한 객체는 같은 객체임 <br>
<% } %>
<% if(response == pageContext.getResponse()) { %>
request 객체와 pageContext.getResponse()가 리턴한 객체는 같은 객체임 <br>
<% } %>
<% if(session == pageContext.getSession()) { %>
request 객체와 pageContext.getSession()가 리턴한 객체는 같은 객체임 <br>
<% } %>
<% if(application == pageContext.getServletContext()) { %>
request 객체와 pageContext.getServletContext()가 리턴한 객체는 같은 객체임 <br>
<% } %>
<hr>
<h3>영역담당 객체는 속성 관련 메서드를 멤버로 가진다.</h3>
<h4>1. page 영역 : pageContext 객체</h4>
<h4>2. request 영역 : request 객체</h4>
<h4>3. session 영역 : session 객체</h4>
<h4>4. application 영역 : application 객체</h4>
<h3>속성 관련 메서드</h3>
<h4> setAttribute("속성명","속성값") : 속성등록</h4>
<h4> Object getAttribute("속성명") : 속성조회. 속성값리턴</h4>
<h4> removeAttribute("속성명") : 속성제거</h4>
</body>
</html>
728x90
반응형