Class AbstractScopeAwareFilter

  • All Implemented Interfaces:
    jakarta.servlet.Filter

    public abstract class AbstractScopeAwareFilter
    extends com.helger.servlet.filter.AbstractHttpServletFilter
    Abstract HTTP servlet filter implementation using the correct scope handling. The scope initialization happens before the main action is executed, and the scope destruction happens after all the whole filter chain finished! If more than one scope aware filter are present in the filter chain, only the filter invoked first creates the request scope. Succeeding scope aware filters wont create a request scope.
    Author:
    Philip Helger
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract com.helger.commons.state.EContinue doHttpFilter​(jakarta.servlet.http.HttpServletRequest aHttpRequest, jakarta.servlet.http.HttpServletResponse aHttpResponse, IRequestWebScope aRequestScope)
      Implement this main filtering method in subclasses.
      void doHttpFilter​(jakarta.servlet.http.HttpServletRequest aHttpRequest, jakarta.servlet.http.HttpServletResponse aHttpResponse, jakarta.servlet.FilterChain aChain)  
      • Methods inherited from class com.helger.servlet.filter.AbstractHttpServletFilter

        doFilter
      • Methods inherited from class com.helger.servlet.filter.AbstractServletFilter

        destroy, getFilterConfig, init, init, toString
    • Constructor Detail

      • AbstractScopeAwareFilter

        protected AbstractScopeAwareFilter()
    • Method Detail

      • doHttpFilter

        @Nonnull
        protected abstract com.helger.commons.state.EContinue doHttpFilter​(@Nonnull
                                                                           jakarta.servlet.http.HttpServletRequest aHttpRequest,
                                                                           @Nonnull
                                                                           jakarta.servlet.http.HttpServletResponse aHttpResponse,
                                                                           @Nonnull
                                                                           IRequestWebScope aRequestScope)
                                                                    throws IOException,
                                                                           jakarta.servlet.ServletException
        Implement this main filtering method in subclasses.
        Parameters:
        aHttpRequest - The HTTP request. Never null.
        aHttpResponse - The HTTP response. Never null.
        aRequestScope - The request scope to be used.
        Returns:
        EContinue.CONTINUE to indicate that the next filter is to be called or EContinue.BREAK to indicate that the next filter does not need to be called! Never return null!
        Throws:
        IOException - In case of an IO error
        jakarta.servlet.ServletException - For non IO errors
      • doHttpFilter

        public final void doHttpFilter​(@Nonnull
                                       jakarta.servlet.http.HttpServletRequest aHttpRequest,
                                       @Nonnull
                                       jakarta.servlet.http.HttpServletResponse aHttpResponse,
                                       @Nonnull
                                       jakarta.servlet.FilterChain aChain)
                                throws IOException,
                                       jakarta.servlet.ServletException
        Specified by:
        doHttpFilter in class com.helger.servlet.filter.AbstractHttpServletFilter
        Throws:
        IOException
        jakarta.servlet.ServletException