Development/Spring
Interceptor 수행 도식도 - 단일 interceptor 수행, 다중 interceptor 수행
codedragon
2019. 10. 31. 16:01
반응형
Interceptor 수행 도식도
· 단일 interceptor 수행
· 다중 interceptor 수행
단일 interceptor 수행
Interceptor에는 3가지 콜백 메소드가 정의되어져 있습니다.
단계 |
설명 |
1 |
요청이 들어오면 Dispatcher servlet을 통해 Interceptor를 거치게 됩니다.
|
2 |
처음 요청이 들어오면 Interceptor의 preHandle() 수행하게 됩니다.
|
3 |
Controller가 수행됩니다. Controller 해당 로직을 수행한 후 그 결과를 postHandle()에 전달합니다. |
4 |
적절한 View통해 응답을 해주게됩니다. |
5 |
응답 페이지가 출력됩니다. |
6 |
Response가 끝나면 afterCompletion()이 수행됩니다. |
다중 interceptor 수행
여러 개의 Interceptor가 존재하는 경우 수행 순서