interceptor

    [Spring] 스프링 인터셉터 - Handler Interceptor

    HandlerInterceptor를 통한 요청 가로채기 Controller가 요청을 처리하기 전/후 처리 실제 Business Logic과 분리되어 처리해야 하는 기능을 넣고 싶을 때 유용하다 @Component public class SessionInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { HttpSession session = request.getSession(); // 세션에 로그인 정보가 있다면 그대로 진행 if (session.getAt..

출처: https://gmnam.tistory.com/157 [Voyager:티스토리]