|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%
pageContext.setAttribute("test", "pageContext Test");
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>EL 내장 객체 사용 예제</title>
</head>
<body>
page 영역의 값 (test2) : ${pageScope.test2}<!-- 해당 속성이 없는 경우 출력 X -->
</body>
</html>
Colored by Color Scripter
|
|

|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%
pageContext.setAttribute("test", "pageContext Test");
request.setAttribute("test", "request Test");
session.setAttribute("test", "session Test");
application.setAttribute("test", "application Test");
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>EL 내장 객체 사용 예제</title>
</head>
<body>
<!-- 해당 속성이 없는 경우 출력 X -->
</body>
</html>
Colored by Color Scripter
|
|

|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%
pageContext.setAttribute("test", "pageContext Test");
request.setAttribute("test", "request Test");
session.setAttribute("test", "session Test");
application.setAttribute("test", "application Test");
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>EL 내장 객체 사용 예제</title>
</head>
<body>
<%--
<!-- 해당 속성이 없는 경우 출력 X -->
</body>
</html>
Colored by Color Scripter
|
|

|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%
request.setCharacterEncoding("euc-kr");
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>
<br>
request 역역의 값 : ${requestScope.test}
<br>
session 영역의 값 : ${sessionScope.test}
<br>
application 영역의 값 : ${applicationScope.test}
<br>
<%--request에서는 id 안씀 충돌나서 session에서만 id사용 request는 id를 제외한 다른 건 사용함 --%>
<%--dispatcher 방식으로 request 가져올 수 있음 --%>
</body>
</html>
Colored by Color Scripter
|

|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%request.setCharacterEncoding("euc-kr"); %>
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>
${test}
</body>
</html>
|
|
페이지가 바뀌면 request랑 page값은 나오지 않음
request 값을 가져오고 싶으면 dispatcher 방식을 사용해야 한다.

|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%
pageContext.setAttribute("test", "pageContext Test");
request.setAttribute("test", "request Test");
session.setAttribute("test", "session Test");
application.setAttribute("test", "application Test");
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>EL 내장 객체 사용 예제</title>
</head>
<body>
<%--
<!-- 해당 속성이 없는 경우 출력 X -->
</body>
</html>
Colored by Color Scripter
|
|
'IT > JSP' 카테고리의 다른 글
| [JSP] EL 03 (0) | 2019.05.20 |
|---|---|
| [JSP] EL 자바빈 사용 (0) | 2019.05.20 |
| [JSP] EL 연습 01 (0) | 2019.05.20 |
| [JSP] JSTL (0) | 2019.05.20 |
| [JSP] 커넥션 풀을 이용한 페이지 제어 연습 02 (0) | 2019.05.16 |