List of usage examples for org.springframework.web.reactive.function.server ServerRequest queryParam
default Optional<String> queryParam(String name)
From source file:com.example.message.GetMessageRequest.java
static GetMessageRequest create(final ServerRequest request) { final Integer page = request.queryParam("page").map(Integer::parseInt).orElse(0); final Integer size = request.queryParam("size").map(Integer::parseInt).orElse(20); return new GetMessageRequest(page, size); }
From source file:com.example.TestEndpoint.java
Mono<ServerResponse> test(final ServerRequest request) { final Optional<String> value = request.queryParam("value"); return Mono.justOrEmpty(value).map(Wrapper::new) .flatMap(v -> ServerResponse.ok().body(Mono.just(v), Wrapper.class)) .switchIfEmpty(ServerResponse.notFound().build()); }
From source file:org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler.java
/** * Check whether the trace attribute has been set on the given request. * @param request the source request//from w w w . j av a 2 s. c om * @return {@code true} if the error trace has been requested, {@code false} otherwise */ protected boolean isTraceEnabled(ServerRequest request) { String parameter = request.queryParam("trace").orElse("false"); return !"false".equalsIgnoreCase(parameter); }