JSTL & EL & Action Tag/EL

EL 내장객체(Implicit Object 1)

pms93 2022. 10. 12. 18:07
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!-- 
	각 다른 내장객체에 동일한 속성이름을 사용 후 Scope명시 없이 EL로 출력 할 경우
	유효범위가 가장 작은 순서(pageContext -> request -> session -> application)로 참조한다.
	
	* 되도록이면 Scope를 명시하는것을 '권장'한다.
 -->
<%
	pageContext.setAttribute("data", "pageContext");
	request.setAttribute("data", "request");
	session.setAttribute("data", "session");
	application.setAttribute("data", "application");
%>
Scope를 명시하지 않은 data 참조 : ${ data } <br><br>

<h4>Scope를 명시한 data 참조</h4>
pageContext : ${ pageScope.data } <br>
request : ${ requestScope.data } <br>
session : ${ sessionScope.data } <br>
application : ${ applicationScope.data } <br>

<a href= "el3_Implicit_B.jsp"/> 이동