Package com.helger.xservlet.filter
Interface IXServletLowLevelFilter
-
- All Known Implementing Classes:
XServletFilterConsistency,XServletFilterSecurityHttpReferrerPolicy,XServletFilterSecurityPoxy,XServletFilterSecurityXFrameOptions
public interface IXServletLowLevelFilterLow-level filter for a single XServlet. It has methods for before and after.- Since:
- 9.0.0
- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidafterRequest(javax.servlet.http.HttpServletRequest aHttpRequest, javax.servlet.http.HttpServletResponse aHttpResponse, com.helger.http.EHttpVersion eHttpVersion, com.helger.commons.http.EHttpMethod eHttpMethod, boolean bInvokeHandler, Throwable aCaughtException, boolean bIsHandledAsync)Invoked after an XServlet request was handled.com.helger.commons.state.EContinuebeforeRequest(javax.servlet.http.HttpServletRequest aHttpRequest, javax.servlet.http.HttpServletResponse aHttpResponse, com.helger.http.EHttpVersion eHttpVersion, com.helger.commons.http.EHttpMethod eHttpMethod)Invoked before an XServlet request is handled.
-
-
-
Method Detail
-
beforeRequest
@Nonnull com.helger.commons.state.EContinue beforeRequest(@Nonnull javax.servlet.http.HttpServletRequest aHttpRequest, @Nonnull javax.servlet.http.HttpServletResponse aHttpResponse, @Nonnull com.helger.http.EHttpVersion eHttpVersion, @Nonnull com.helger.commons.http.EHttpMethod eHttpMethod) throws javax.servlet.ServletException, IOException
Invoked before an XServlet request is handled. This method is created before the request is created! Exceptions occurring in this method will be propagated to the outside, so be careful :)- Parameters:
aHttpRequest- HTTP servlet request. Nevernull.aHttpResponse- HTTP servlet response. Nevernull.eHttpVersion- HTTP version. Nevernull.eHttpMethod- HTTP method. Nevernull.- Returns:
EContinue.CONTINUEto continue processing, orEContinue.BREAKif this request should not be processed, in which case the HttpServletResponse must contain a valid response!- Throws:
javax.servlet.ServletException- in case of business logic error.IOException- in case of IO error.
-
afterRequest
default void afterRequest(@Nonnull javax.servlet.http.HttpServletRequest aHttpRequest, @Nonnull javax.servlet.http.HttpServletResponse aHttpResponse, @Nonnull com.helger.http.EHttpVersion eHttpVersion, @Nonnull com.helger.commons.http.EHttpMethod eHttpMethod, boolean bInvokeHandler, @Nullable Throwable aCaughtException, boolean bIsHandledAsync) throws javax.servlet.ServletException, IOException
Invoked after an XServlet request was handled. After is always called, even if before request was canceled (in a finally)! Exceptions occurring in this method will be propagated to the outside, so be careful :)
Note: the response cannot be modified in implementations of this method - they should be considered read-only. Also HTTP headers can usually NOT be modified in this method.- Parameters:
aHttpRequest- HTTP servlet request. Nevernull.aHttpResponse- HTTP servlet response. Nevernull.eHttpVersion- HTTP version. Nevernull.eHttpMethod- HTTP method. Nevernull.bInvokeHandler-trueif the main handler was invoked,falseifbeforeRequest(HttpServletRequest, HttpServletResponse, EHttpVersion, EHttpMethod)avoided the execution of the request.aCaughtException- An optionally caught exception. May benull. The exception was already logged, so please don't log it again!bIsHandledAsync-trueif the request is handled asynchronously- Throws:
javax.servlet.ServletException- in case of business logic errorIOException- in case of IO error
-
-