Class AbstractXFilterUnifiedResponse

  • All Implemented Interfaces:
    javax.servlet.Filter

    public abstract class AbstractXFilterUnifiedResponse
    extends AbstractXFilter
    Abstract XFilter implementation using UnifiedResponse objects.
    Since:
    9.0.3
    Author:
    Philip Helger
    • Constructor Detail

      • AbstractXFilterUnifiedResponse

        protected AbstractXFilterUnifiedResponse()
    • Method Detail

      • onFilterBefore

        @Nonnull
        protected abstract com.helger.commons.state.EContinue onFilterBefore​(@Nonnull
                                                                             com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope,
                                                                             @Nonnull
                                                                             com.helger.servlet.response.UnifiedResponse aUnifiedResponse)
                                                                      throws IOException,
                                                                             javax.servlet.ServletException
        Overwrite this method to fill your response.
        Parameters:
        aRequestScope - The request scope to use. There is no direct access to the HttpServletResponse. Everything must be handled with the unified response! Never null.
        aUnifiedResponse - The response object to be filled. Never null.
        Returns:
        If EContinue.BREAK is returned, the content of the unified response is rendered to the HTTP servlet response and the filter chain stops. On EContinue.CONTINUE the content of the unified response is discarded and the filter chain continues as normal.
        Throws:
        IOException - In case of an error
        javax.servlet.ServletException - In case of an error
      • onFilterBefore

        @Nonnull
        @OverrideOnDemand
        public final com.helger.commons.state.EContinue onFilterBefore​(@Nonnull
                                                                       javax.servlet.http.HttpServletRequest aHttpRequest,
                                                                       @Nonnull
                                                                       javax.servlet.http.HttpServletResponse aHttpResponse,
                                                                       @Nonnull
                                                                       com.helger.web.scope.IRequestWebScope aRequestScope)
                                                                throws IOException,
                                                                       javax.servlet.ServletException
        Description copied from class: AbstractXFilter
        Invoked before the rest of the request is processed.
        Overrides:
        onFilterBefore in class AbstractXFilter
        Parameters:
        aHttpRequest - The HTTP request. Never null.
        aHttpResponse - The HTTP response. Never null.
        aRequestScope - Current request scope. Never null.
        Returns:
        EContinue.CONTINUE to continue processing the request, EContinue.BREAK otherwise.
        Throws:
        IOException - In case of IO error
        javax.servlet.ServletException - In case of business level error