java.util.function.BiConsumer<ServerRequest,ServerResponse>JsonSupport, RequestPredicate.ConditionalHandler, SecurityHandler@FunctionalInterface public interface Handler extends java.util.function.BiConsumer<ServerRequest,ServerResponse>
Routing.Builder,
Routing.Rules| Modifier and Type | Interface | Description |
|---|---|---|
static interface |
Handler.EntityHandler<T> |
| Modifier and Type | Method | Description |
|---|---|---|
void |
accept(ServerRequest req,
ServerResponse res) |
|
static <T> Handler |
of(java.lang.Class<T> entityType,
Handler.EntityHandler<T> entityHandler) |
Creates new instance of the
Handler for the entity representing HTTP request content. |
static <T> Handler |
of(java.lang.Class<T> entityType,
Handler.EntityHandler<T> entityHandler,
ErrorHandler<java.lang.Throwable> entityReadErrorHandler) |
Creates new instance of the
Handler for the entity representing HTTP request content. |
void accept(ServerRequest req, ServerResponse res)
accept in interface java.util.function.BiConsumer<ServerRequest,ServerResponse>req - an HTTP server request.res - an HTTP server response.static <T> Handler of(java.lang.Class<T> entityType, Handler.EntityHandler<T> entityHandler)
Handler for the entity representing HTTP request content. See ServerRequest
for more details how response can be represented as a java type.
Created handler forwards any error created during entity read or conversion to the standard error handling
(ServerRequest.next(Throwable)).
T - a type of the entityentityType - a java type of the entityentityHandler - an entity handler to handle request entityHandler instancestatic <T> Handler of(java.lang.Class<T> entityType, Handler.EntityHandler<T> entityHandler, ErrorHandler<java.lang.Throwable> entityReadErrorHandler)
Handler for the entity representing HTTP request content. See ServerRequest
for more details how response can be represented as a java type.T - a type of the entityentityType - a java type of the entityentityHandler - an entity handler to handle request entityentityReadErrorHandler - an error handler to handle state when entity cannot be read or convert to the requested
typeHandler instanceCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.