Interceptor

    spring - interceptor

    역할 Interceptor란 컨트롤러에 들어오는 요청 HttpRequest와 컨트롤러가 응답하는 HttpResponse를 가로채는 역할을 한다. 사용 이유 - 코드 재사용성 증가 - 메모리 낭비, 서버 부하 감소 - 코드 누락에 대한 위험성 감소 src > main > demo import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.c..