일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 개햄문자치환
- springframework
- 개행문자
- 개발환경
- 자바
- 코테
- mysql
- 롤백
- @value
- application.properties
- Serializable
- java
- sql
- spring
- 660mbt
- Object-oriented
- Spring Framework
- springboot
- 직렬화
- value 어노테이션
- 쿼리
- spring boot
- 줄바꿈
- query
- vue.js
- 업로드 파일 용량
- 레오폴드
- Docker
- 다중DB
- 트랜잭션
Archives
- Today
- Total
supremest.35 개발 블로그
[Spring] 인터셉터(Interceptor)로 모든 요청 특정 페이지로 이동 시키기 본문
Study/Spring Framework
[Spring] 인터셉터(Interceptor)로 모든 요청 특정 페이지로 이동 시키기
supremest.35 2022. 1. 25. 22:37운영중인 서비스를 중단시키고 작업을 진행해야할 때, 사용자의 모든 요청을 서비스 중단 페이지로 이동하게끔 구현하고 작업을 해야할 때가 있다.
그럴때 모든 요청을 서비스 중단 페이지로 이동시키게끔 인터셉터를 통해 구현할 수 있다.
구현
- 이동시킬 페이지 구현 및 컨트롤러 구현
- "/" 도메인 -> index.html 호출
- "/notice" 도메인 -> notice.html 호출
- "/notice" uri를 제외한 모든 요청을 "/notice"로 리다이렉트
- notice.html에 적용된 이미지, js, css 파일을 예외시키기 위한 설정
결과
메인페이지인 localhost:8080으로 이동시 localhost:8080/notice로 리다이렉트됨
'Study > Spring Framework' 카테고리의 다른 글
[Spring Boot] 의존성 주입 (0) | 2023.03.07 |
---|---|
[Spring Boot] @Value 어노테이션이 값을 못 가져온다. (0) | 2022.05.26 |
[Spring Boot] 개발 환경에 따라 설정값 세팅하기 (0) | 2022.05.26 |