Class FilterExceptionResolverFilter

  • All Implemented Interfaces:
    javax.servlet.Filter, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.EnvironmentAware, org.springframework.core.env.EnvironmentCapable, org.springframework.web.context.ServletContextAware

    public class FilterExceptionResolverFilter
    extends org.springframework.web.filter.OncePerRequestFilter
    Resolves exceptions to error views for when exceptions are thrown from a filter (e.g. CartResolutionFilter).
    Author:
    Jacob Mitash
    • Field Summary

      • Fields inherited from class org.springframework.web.filter.OncePerRequestFilter

        ALREADY_FILTERED_SUFFIX
      • Fields inherited from class org.springframework.web.filter.GenericFilterBean

        logger
    • Constructor Summary

      Constructors 
      Constructor Description
      FilterExceptionResolverFilter​(org.springframework.web.servlet.DispatcherServlet dispatcherServlet, List<org.springframework.web.servlet.HandlerExceptionResolver> exceptionResolvers)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected Object determineHandler​(@NonNull javax.servlet.http.HttpServletRequest request, RuntimeException ex)  
      protected void doFilterInternal​(@NonNull javax.servlet.http.HttpServletRequest request, @NonNull javax.servlet.http.HttpServletResponse response, @NonNull javax.servlet.FilterChain filterChain)  
      protected org.springframework.web.servlet.DispatcherServlet getDispatcherServlet()  
      protected List<org.springframework.web.servlet.HandlerExceptionResolver> getExceptionResolvers()  
      protected void handleException​(@NonNull javax.servlet.http.HttpServletRequest request, @NonNull javax.servlet.http.HttpServletResponse response, RuntimeException ex)  
      • Methods inherited from class org.springframework.web.filter.OncePerRequestFilter

        doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
      • Methods inherited from class org.springframework.web.filter.GenericFilterBean

        addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
    • Constructor Detail

      • FilterExceptionResolverFilter

        public FilterExceptionResolverFilter​(org.springframework.web.servlet.DispatcherServlet dispatcherServlet,
                                             @Nullable
                                             List<org.springframework.web.servlet.HandlerExceptionResolver> exceptionResolvers)
    • Method Detail

      • doFilterInternal

        protected void doFilterInternal​(@NonNull
                                        @NonNull javax.servlet.http.HttpServletRequest request,
                                        @NonNull
                                        @NonNull javax.servlet.http.HttpServletResponse response,
                                        @NonNull
                                        @NonNull javax.servlet.FilterChain filterChain)
                                 throws javax.servlet.ServletException,
                                        IOException
        Specified by:
        doFilterInternal in class org.springframework.web.filter.OncePerRequestFilter
        Throws:
        javax.servlet.ServletException
        IOException
      • handleException

        protected void handleException​(@NonNull
                                       @NonNull javax.servlet.http.HttpServletRequest request,
                                       @NonNull
                                       @NonNull javax.servlet.http.HttpServletResponse response,
                                       RuntimeException ex)
      • determineHandler

        protected Object determineHandler​(@NonNull
                                          @NonNull javax.servlet.http.HttpServletRequest request,
                                          RuntimeException ex)
      • getDispatcherServlet

        protected org.springframework.web.servlet.DispatcherServlet getDispatcherServlet()
      • getExceptionResolvers

        @Nullable
        protected List<org.springframework.web.servlet.HandlerExceptionResolver> getExceptionResolvers()