Notice
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
- container
- ansible
- playbook
- AWS Database
- 아마존웹서비스
- AWS Certificate
- Reverse Proxy
- kubernetes
- 앤서블
- VPC
- Cloud Spanner
- Kubernetes Engine
- Cloud Bigtable
- Google Cloud Platrofm
- gcp
- Cloud SQL
- Google Cloud
- Compute Engine
- Cloud Datastore
- Cloud Storage
- Google Cloud Platform
- Google Cloud Platorm
- Amazon Web Service
- GKE
- 리버스 프록시
- Solution Architect Certificate
- Solution Architect
- AWS Solution Architect
- AWS
- AWS 자격증
Archives
- Today
- Total
sungwony
[웹프로그래밍] 리프래시 / 리다이렉트 본문
'리프래시(Refresh)'
: 일정 시간이 지나고 나서 자동으로 서버에 요청을 보내는 방법
1) 응답 헤더를 활용한 리프래시
response.addHeader("Refresh", "1;url=list");
응답 정보를 살펴보면
HTTP/1.1 200 OK
Server: ...
Refresh: 1;url=test
...
'Refresh' 헤더 값의 숫자 '1'은 응답 본문을 출력하고 나서 1초 뒤에 다시 서비스를 요청하라는 뜻. 이때 url은 다시 요청할 서비스 주소.
2) HTML의 meta 태그를 이용한 리프래시
PrintWriter out = response.getWriter();
out.println("<html><head>"
out.println("<meta http-equiv='Refresh' content='1'; url=test'>");
out.println("</head><body></body></html>");
'리다이랙트(Redirect)'
: 클라이언트에서 결과를 출력하지 않고 다른 페이지로 이동하는 방법
1) 리다이렉트 메서드 sendRedirect()
response.sendRedirect("test");
응답 정보
HTTP/1.1 302 Found
Server: ...
Location: http://localhost:8080/webTest/test
Content-Length: 0
Date: ...
Location에 기재된 URL로 다시 요청을 보낸다.
'development > 웹프로그래밍' 카테고리의 다른 글
[웹프로그래밍]포워딩과 인클루딩 (0) | 2017.05.26 |
---|---|
[웹프로그래밍]JSP (0) | 2017.05.23 |
[웹프로그래밍] 필터 (0) | 2017.05.23 |
[웹프로그래밍]HTTP, GET, POST 이해하기 (0) | 2017.05.22 |
[기타]HTTP 프로토콜 (0) | 2017.03.29 |