public static class RequestPredicate.ConditionalHandler extends Object implements Handler
Handler that conditionally delegates to other Handler
instances based on a RequestPredicate.
There can be at most 2 handlers: a required one for matched requests and
an optional one for requests that are not matched. If the handler for non
matched requests is not provided, such request will return a 404
response.Handler.EntityHandler<T>| Modifier and Type | Method and Description |
|---|---|
void |
accept(ServerRequest req,
ServerResponse res)
|
Handler |
otherwise(Handler handler)
Set the
Handler to use when the predicate does not match the
request. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitandThenpublic void accept(ServerRequest req, ServerResponse res)
Handleraccept in interface Handleraccept in interface BiConsumer<ServerRequest,ServerResponse>req - an HTTP server request.res - an HTTP server response.Copyright © 2018–2019 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms.