DATA 분석 교육 과정 (2024.02~08)/JSP&Servlet

JSP_다른페이지로 이동하기

글로리아-89 2024. 4. 15. 15:24
728x90

<HTML: Ex14_sendRedirect>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

<form action="Ex14_sendRedirect.jsp"></form>
<input type = "submit" value = "네이버로 이동">

</body>
</html>

 

 

<JSP: Ex14_sendRedirect> 

<%@ 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>

<%
System.out.println("EX13");
  // sendRedirect("이동할 주소"): 현재 페이지를 중단하고 다음 웹 페이지를 호출하는 기능
response. sendRedirect("http://www.naver.com");
%>

</body>
</html>

 

출처: 스마트인재개발원

728x90
반응형