public interface IXServletSimpleHandler extends IXServletBasicHandler
| Modifier and Type | Method and Description |
|---|---|
default com.helger.servlet.response.UnifiedResponse |
createUnifiedResponse(com.helger.http.EHttpVersion eHttpVersion,
com.helger.commons.http.EHttpMethod eHttpMethod,
javax.servlet.http.HttpServletRequest aHttpRequest,
com.helger.web.scope.IRequestWebScope aRequestScope)
Create a unified response object.
|
default LocalDateTime |
getLastModificationDateTime(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)
Get the last modification date time for the current request.
|
default String |
getSupportedETag(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)
Get the ETag supported for this request.
|
void |
handleRequest(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope,
com.helger.servlet.response.UnifiedResponse aUnifiedResponse)
This is the main request handling method.
|
default com.helger.commons.state.EContinue |
initRequestState(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope,
com.helger.servlet.response.UnifiedResponse aUnifiedResponse)
This callback method is unconditionally called before the last-modification
checks are performed.
|
default com.helger.commons.state.EContinue |
onException(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope,
com.helger.servlet.response.UnifiedResponse aUnifiedResponse,
Throwable t)
Called when an exception occurred in
handleRequest(IRequestWebScopeWithoutResponse, UnifiedResponse). |
default void |
onRequestBegin(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)
Called before a valid request is handled.
|
default void |
onRequestEnd(Throwable aCaughtException)
Called after a valid request was processed.
|
onServletDestroy, onServletInit@Nonnull default com.helger.servlet.response.UnifiedResponse createUnifiedResponse(@Nonnull com.helger.http.EHttpVersion eHttpVersion, @Nonnull com.helger.commons.http.EHttpMethod eHttpMethod, @Nonnull javax.servlet.http.HttpServletRequest aHttpRequest, @Nonnull com.helger.web.scope.IRequestWebScope aRequestScope)
eHttpVersion - HTTP version of the current request.eHttpMethod - HTTP method of the current request.aHttpRequest - Current HTTP requestaRequestScope - Current HTTP request scopenull.@OverrideOnDemand default com.helger.commons.state.EContinue initRequestState(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope, @Nonnull com.helger.servlet.response.UnifiedResponse aUnifiedResponse)
aRequestScope - The request scope that will be used for processing the request.
Never null.aUnifiedResponse - The response object to be filled. Never null.EContinue.BREAK to stop processing (e.g. because a resource
does not exist), EContinue.CONTINUE to continue processing
as usual.@Nullable default LocalDateTime getLastModificationDateTime(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)
initRequestState(IRequestWebScopeWithoutResponse, UnifiedResponse)
.aRequestScope - The request scope that will be used for processing the request.
Never null.null if no last modification date time can be
determined@Nullable default String getSupportedETag(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)
aRequestScope - The request scope that will be used for processing the request.
Never null.null if this servlet does not support ETags@OverrideOnDemand @Nonnull default void onRequestBegin(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)
aRequestScope - The request scope that will be used for processing the request.
Never null.void handleRequest(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope, @Nonnull com.helger.servlet.response.UnifiedResponse aUnifiedResponse) throws Exception
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.Exception - In case of an error@OverrideOnDemand @Nonnull default com.helger.commons.state.EContinue onException(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope, @Nonnull com.helger.servlet.response.UnifiedResponse aUnifiedResponse, @Nonnull Throwable t)
handleRequest(IRequestWebScopeWithoutResponse, UnifiedResponse).
This method is only called for non-request-cancel operations.aRequestScope - The source request scope. Never null.aUnifiedResponse - The response to the current request. Never null.t - The Throwable that occurred. Never null.EContinue.CONTINUE to propagate the Exception,
EContinue.BREAK to swallow it. May not be
null.@OverrideOnDemand default void onRequestEnd(@Nullable Throwable aCaughtException)
onException(IRequestWebScopeWithoutResponse, UnifiedResponse, Throwable)aCaughtException - null if no exception occurred, non-null in
case of exception.Copyright © 2017–2019 Philip Helger. All rights reserved.