2013년 7월 10일 수요일

(130710) 13일차 ResponseTest.jsp (response 객체 테스트)

 - response 객체 : 사용자에게 응답해줄 때 사용


 - 소스
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
이 페이지의 내용이 나올까요?
<%
// forward는 버퍼에 담겨진 내용을 보여주는 것이므로 제어권이 넘어가지는 않았었음.
// response 객체는 제어권 자체가 표기한 URL로 넘어감.
response.sendRedirect("http://hongkwan.blogspot.kr/");
%>
</body>
</html>


 - 결과