• 거의 사용되지 않는 객체

    • HTTP 헤더에 내용 추가
    • 다른 페이지로 리다이렉트(redirect)
  • 리다이렉트 시키기

    • response.sendRedirect() 메소드 사용

<%@ page contentType="text/html; charset=utf-8" %>

<!DOCTYPE html>
<html>
<head>
    <title>리다이렉트페이지</title>
</head>
<body>

<%
    String redirect = request.getParameter("redirect");
    if(redirect != null && redirect.equals("yes")) {
        response.sendRedirect("/chap03/form.jsp");
    }
%>

hello

</body>
</html>

' > JSP' 카테고리의 다른 글

6. 에러 처리와 에러 페이지  (0) 2020.07.19
5. out, application 객체  (0) 2020.07.19
3. GET방식 / POST방식  (0) 2020.07.19
2. request 기본 객체  (0) 2020.07.19
1. JSP 페이지의 구성요소  (0) 2020.07.19

+ Recent posts