Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Dispatcher
- POST방식
- 다형성 #부모타입 #자식타입
- 요구사항정의서
- Break
- WAS
- Spring MVC
- https://www.inflearn.com/course/lecture?courseslug=%ea%b9%80%ec%98%81%ed%95%9c%ec%9d%98-%ec%8b%a4%ec%a0%84-%ec%9e%90%eb%b0%94-%ea%b8%b0%eb%b3%b8%ed%8e%b8&unitid=194709&category=questiondetail&tab=community&q=1314387
- Forwarding
- 한글깨짐
- JSON형식의 response
- 피그마
- webserver #WAS #ServerApp
- 김영한
- Servlet
- 톰캣
- 매핑 #
- while문
- Request
- 화면정의서
- CONTINUE
- sendRedirect
- https://www.inflearn.com/course/lecture?courseslug=%ea%b9%80%ec%98%81%ed%95%9c%ec%9d%98-%ec%8b%a4%ec%a0%84-%ec%9e%90%eb%b0%94-%ea%b8%b0%eb%b3%b8%ed%8e%b8&unitid=194690
- GET방식
- xml
- https://www.inflearn.com/course/lecture?courseslug=%ea%b9%80%ec%98%81%ed%95%9c%ec%9d%98-%ec%8b%a4%ec%a0%84-%ec%9e%90%eb%b0%94-%ea%b8%b0%eb%b3%b8%ed%8e%b8&unitid=194711
Archives
- Today
- Total
Step it up now
sendRedirect 본문
- a.jsp
<%@ 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>a.jsp페이지</h2>
<p>내용1</p>
<p>내용2</p>
<%
//스크립틀릿
//sendRedirect 만나면 기존 요청 끊고 새로운 요청 일어나서 a.jsp는 실행 안 돼
response.sendRedirect("b.jsp");
%>
<!-- --------------------------이후---------------------------- -->
<p>여기 코드는 실행될까?</p>
<!-- 15번을 주석으로 막으면 a.jsp에서 머무르고 있기에 a.jsp가 실행된다 -->
</body>
</html>
📢 localhost:8000/move/a.jsp 로 입력
response 객체는 sendRedirect()의 기존 응답을 끝내고 b.jsp로 이동한다
- b.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>b.jsp</title>
</head>
<body>
<h2>b.jsp페이지</h2>
<p>b페이지 내용1</p>
<p>b페이지 내용2</p>
</body>
</html>
📢 주소창이 b.jsp로 변한다
redirect( )에 의해 b.jsp의 화면을 보여준다
'수업 > servlet, JSP' 카테고리의 다른 글
[POJO] 오라클에 db 업데이트 (0) | 2023.12.12 |
---|---|
POST 방식 한글 깨질 때 (0) | 2023.12.12 |
Front Controller (1) | 2023.12.05 |
req/res3) forwarding, request (1) | 2023.12.05 |
req/res2) Redirect (1) | 2023.12.05 |