Interceptor 수행 도식도 - 단일 interceptor 수행, 다중 interceptor 수행

CODEDRAGON Development/Spring

반응형



 

 

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 존재하는 경우 수행 순서


 


반응형