Class LoggingRequestInterceptor

  • All Implemented Interfaces:
    org.springframework.web.servlet.AsyncHandlerInterceptor, org.springframework.web.servlet.HandlerInterceptor

    @Component
    public class LoggingRequestInterceptor
    extends org.springframework.web.servlet.handler.HandlerInterceptorAdapter
    Request interceptor, used for logging response code, accessed URI and execution time.
    • Constructor Detail

      • LoggingRequestInterceptor

        public LoggingRequestInterceptor()
    • Method Detail

      • preHandle

        public boolean preHandle​(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 Object handler)
        Specified by:
        preHandle in interface org.springframework.web.servlet.HandlerInterceptor
        Overrides:
        preHandle in class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
      • afterCompletion

        public void afterCompletion​(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response,
                                    Object handler,
                                    Exception ex)
        Specified by:
        afterCompletion in interface org.springframework.web.servlet.HandlerInterceptor
        Overrides:
        afterCompletion in class org.springframework.web.servlet.handler.HandlerInterceptorAdapter