2024-12-19


<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h2>JSP 표현식으로 scope 내용 출력</h2>
<h3>
pageContext >>> <%= pageContext.getAttribute("Res") %> <br>
<%-- null값이 나옴 --%>
request >>> <%= request.getAttribute("R") %> <br>
session >>> <%= session.getAttribute("S") %> <br>
application >> <%= application.getAttribute("A") %> <br>
</h3>
<hr>
<h2>표현언어(EL)로 scope 내용 출력</h2>
<h3>
pageContext >>> ${ pageScope.Res } == ${ Res } <br>
<%-- 값이 아예 안나옴 --%>
request >>> ${ requestScope.R } == ${ R } <br>
session >>> ${ session.S } == ${ S } <br>
application >>> ${ application.A } == ${ A } <br>
</h3>
<hr>
<script type="text/javascript">
location.href="Ex07.jsp"
</script>
</body>
</html>'JSP > 기초 내용 정리' 카테고리의 다른 글
| JSP(EL)_08~9 (0) | 2024.12.19 |
|---|---|
| JSP(EL)_07 (0) | 2024.12.19 |
| JSP(EL)_05 (0) | 2024.12.19 |
| JSP(EL)_04 (0) | 2024.12.19 |
| JSP(EL)_03 (0) | 2024.12.19 |