Package com.helger.web.servlets.scope
Class AbstractScopeAwareFilter
- java.lang.Object
-
- com.helger.servlet.filter.AbstractServletFilter
-
- com.helger.servlet.filter.AbstractHttpServletFilter
-
- com.helger.web.servlets.scope.AbstractScopeAwareFilter
-
- All Implemented Interfaces:
jakarta.servlet.Filter
public abstract class AbstractScopeAwareFilter extends com.helger.servlet.filter.AbstractHttpServletFilterAbstract 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
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractScopeAwareFilter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract com.helger.commons.state.EContinuedoHttpFilter(jakarta.servlet.http.HttpServletRequest aHttpRequest, jakarta.servlet.http.HttpServletResponse aHttpResponse, IRequestWebScope aRequestScope)Implement this main filtering method in subclasses.voiddoHttpFilter(jakarta.servlet.http.HttpServletRequest aHttpRequest, jakarta.servlet.http.HttpServletResponse aHttpResponse, jakarta.servlet.FilterChain aChain)
-
-
-
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. Nevernull.aHttpResponse- The HTTP response. Nevernull.aRequestScope- The request scope to be used.- Returns:
EContinue.CONTINUEto indicate that the next filter is to be called orEContinue.BREAKto indicate that the next filter does not need to be called! Never returnnull!- Throws:
IOException- In case of an IO errorjakarta.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:
doHttpFilterin classcom.helger.servlet.filter.AbstractHttpServletFilter- Throws:
IOExceptionjakarta.servlet.ServletException
-
-