https://supawer0728.github.io/2018/04/04/spring-filter-interceptor/
(Spring)Filter와 Interceptor의 차이
서론Spring을 익힌지 얼마 되지 않았을 때, 회원 인증 로직을 구현할 일이 생겼었다. 그 인증을 구현하기 위해 Filter와 Interceptor를 조사했었다. 하지만 Filter와 Interceptor를 어떤 경우에 써야 좋은지 �
supawer0728.github.io
![](https://blog.kakaocdn.net/dn/beKEWw/btqFWcVqQ5i/ithz6YPnqIBzXJ9kv9CUFk/img.png)
Filter와 Interceptor의 차이
1. 호출 시점
Filter는 DispatcherServlet이 실행되기 전 , Interceptor는 DispatcherServlet이 실행된 후
2. 설정 위치
Filter는 web.xml , Interceptor는 spring-servlet.xml
3. 구현 방식
Filter는 web.xml에서 설정을 하면 구현이 가능하지만, Interceptor는 설정은 물론 메서드 구현이 필요합니다.
'framework > spring' 카테고리의 다른 글
싱글톤 - 더블 체크드 락킹(Double Checking Locking) (0) | 2020.08.06 |
---|---|
즉시로딩과 지연로딩 (0) | 2020.08.03 |
스프링 구조 (0) | 2020.07.24 |
스프링 요청패킷 로깅하기 (0) | 2020.07.24 |
MyBatis Mapper 설정하기 (0) | 2020.05.21 |