org.springframework.web.servlet.handler

Class HandlerInterceptorAdapter

  • java.lang.Object
    • org.springframework.web.servlet.handler.HandlerInterceptorAdapter
    • Constructor Detail

      • HandlerInterceptorAdapter

        public HandlerInterceptorAdapter()
    • Method Detail

      • preHandle

        public boolean preHandle(HttpServletRequest request,
                                 HttpServletResponse response,
                                 java.lang.Object handler)
                          throws java.lang.Exception
        This implementation always returns true.
        Specified by:
        preHandle in interface HandlerInterceptor
        Parameters:
        request - current HTTP request
        response - current HTTP response
        handler - chosen handler to execute, for type and/or instance evaluation
        Returns:
        true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherServlet assumes that this interceptor has already dealt with the response itself.
        Throws:
        java.lang.Exception - in case of errors
      • postHandle

        public void postHandle(HttpServletRequest request,
                               HttpServletResponse response,
                               java.lang.Object handler,
                               @Nullable
                               ModelAndView modelAndView)
                        throws java.lang.Exception
        This implementation is empty.
        Specified by:
        postHandle in interface HandlerInterceptor
        Parameters:
        request - current HTTP request
        response - current HTTP response
        handler - handler (or HandlerMethod) that started asynchronous execution, for type and/or instance examination
        modelAndView - the ModelAndView that the handler returned (can also be null)
        Throws:
        java.lang.Exception - in case of errors
      • afterCompletion

        public void afterCompletion(HttpServletRequest request,
                                    HttpServletResponse response,
                                    java.lang.Object handler,
                                    @Nullable
                                    java.lang.Exception ex)
                             throws java.lang.Exception
        This implementation is empty.
        Specified by:
        afterCompletion in interface HandlerInterceptor
        Parameters:
        request - current HTTP request
        response - current HTTP response
        handler - handler (or HandlerMethod) that started asynchronous execution, for type and/or instance examination
        ex - exception thrown on handler execution, if any
        Throws:
        java.lang.Exception - in case of errors
      • afterConcurrentHandlingStarted

        public void afterConcurrentHandlingStarted(HttpServletRequest request,
                                                   HttpServletResponse response,
                                                   java.lang.Object handler)
                                            throws java.lang.Exception
        This implementation is empty.
        Specified by:
        afterConcurrentHandlingStarted in interface AsyncHandlerInterceptor
        Parameters:
        request - the current request
        response - the current response
        handler - the handler (or HandlerMethod) that started async execution, for type and/or instance examination
        Throws:
        java.lang.Exception - in case of errors