We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
테코톡 블로그 정리: [10분 테코톡] 조시, 쿤의 서블릿 필터 & 스프링 인터셉터 정리
init()
doFilter()
destroy()
@ControllerAdvice
preHandle()
postHandle()
afterCompletion()
파라미터. 필터와 인터셉터는 HttpServletRequest, HttpServletResponse를 파라미터로 사용한다. 이에 비해 AOP를 적용할 때는 메서드와 파라미터 타입이 제각각이므로 이에 대한 부가 작업이 필요하다.
Ref. [BackTony 블로그] 면접 시리즈2-Spring, Java
The text was updated successfully, but these errors were encountered:
No branches or pull requests
테코톡 블로그 정리: [10분 테코톡] 조시, 쿤의 서블릿 필터 & 스프링 인터셉터 정리
Filter
init()
: 필터 생성될 때 단 한번 호출doFilter()
: 요청이 들어올때마다 호출. 부가작업 처리destroy()
: 필터가 소멸될 때 단 한번 호출Interceptor
@ControllerAdvice
가 처리 가능preHandle()
: Handler 실행 전 수행되는 메서드. 부가 로직 처리 가능postHandle()
: Handler 실행 후 수행되는 메서드. ModelAndView를 통해 추가적인 작업 가능. 최근에는 JSON 형태로 데이터를 제공하는 REST API 기반의 컨트롤러가 사용되면서 잘 사용하지 않음afterCompletion()
: Handler 실행 후 수행되는 메서드. Exception에 대해 추가적인 작업 가능. 리소스 정리(반환) 가능AOP와 차이
파라미터. 필터와 인터셉터는 HttpServletRequest, HttpServletResponse를 파라미터로 사용한다. 이에 비해 AOP를 적용할 때는 메서드와 파라미터 타입이 제각각이므로 이에 대한 부가 작업이 필요하다.
Ref.
[BackTony 블로그] 면접 시리즈2-Spring, Java
The text was updated successfully, but these errors were encountered: