org.springframework.web.servlet.handler

Class AbstractHandlerMethodExceptionResolver

    • Constructor Detail

      • AbstractHandlerMethodExceptionResolver

        public AbstractHandlerMethodExceptionResolver()
    • Method Detail

      • doResolveException

        @Nullable
        protected final ModelAndView doResolveException(HttpServletRequest request,
                                                                  HttpServletResponse response,
                                                                  @Nullable
                                                                  java.lang.Object handler,
                                                                  java.lang.Exception ex)
        Description copied from class: AbstractHandlerExceptionResolver
        Actually resolve the given exception that got thrown during handler execution, returning a ModelAndView that represents a specific error page if appropriate.

        May be overridden in subclasses, in order to apply specific exception checks. Note that this template method will be invoked after checking whether this resolved applies ("mappedHandlers" etc), so an implementation may simply proceed with its actual exception handling.

        Specified by:
        doResolveException in class AbstractHandlerExceptionResolver
        Parameters:
        request - current HTTP request
        response - current HTTP response
        handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
        ex - the exception that got thrown during handler execution
        Returns:
        a corresponding ModelAndView to forward to, or null for default processing in the resolution chain
      • doResolveHandlerMethodException

        @Nullable
        protected abstract ModelAndView doResolveHandlerMethodException(HttpServletRequest request,
                                                                                  HttpServletResponse response,
                                                                                  @Nullable
                                                                                  HandlerMethod handlerMethod,
                                                                                  java.lang.Exception ex)
        Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.

        May be overridden in subclasses, in order to apply specific exception checks. Note that this template method will be invoked after checking whether this resolved applies ("mappedHandlers" etc), so an implementation may simply proceed with its actual exception handling.

        Parameters:
        request - current HTTP request
        response - current HTTP response
        handlerMethod - the executed handler method, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
        ex - the exception that got thrown during handler execution
        Returns:
        a corresponding ModelAndView to forward to, or null for default processing