Merge branch '5.3.x'

This commit is contained in:
Sam Brannen
2021-09-29 16:56:33 +02:00
74 changed files with 234 additions and 225 deletions

View File

@@ -32,7 +32,7 @@ import reactor.core.publisher.Mono;
*
* Mono<String> bodyMono = exchangeFunction
* .exchange(request)
* .flatMap(response -> response.bodyToMono(String.class));
* .flatMap(response -> response.bodyToMono(String.class));
* </pre>
*
* @author Arjen Poutsma

View File

@@ -522,7 +522,7 @@ public interface WebClient {
* Mono&lt;Object&gt; entityMono = client.get()
* .uri("/persons/1")
* .accept(MediaType.APPLICATION_JSON)
* .exchangeToMono(response -> {
* .exchangeToMono(response -&gt; {
* if (response.statusCode().equals(HttpStatus.OK)) {
* return response.bodyToMono(Person.class);
* }
@@ -554,7 +554,7 @@ public interface WebClient {
* Mono&lt;Object&gt; entityMono = client.get()
* .uri("/persons")
* .accept(MediaType.APPLICATION_JSON)
* .exchangeToFlux(response -> {
* .exchangeToFlux(response -&gt; {
* if (response.statusCode().equals(HttpStatus.OK)) {
* return response.bodyToFlux(Person.class);
* }
@@ -751,7 +751,7 @@ public interface WebClient {
* Provide a function to map specific error status codes to an error
* signal to be propagated downstream instead of the response.
* <p>By default, if there are no matching status handlers, responses
* with status codes >= 400 are mapped to
* with status codes &gt;= 400 are mapped to
* {@link WebClientResponseException} which is created with
* {@link ClientResponse#createException()}.
* <p>To suppress the treatment of a status code as an error and process
@@ -766,7 +766,7 @@ public interface WebClient {
* .retrieve()
* .bodyToMono(Account.class)
* .onErrorResume(WebClientResponseException.class,
* ex -> ex.getRawStatusCode() == 404 ? Mono.empty() : Mono.error(ex));
* ex -&gt; ex.getRawStatusCode() == 404 ? Mono.empty() : Mono.error(ex));
* </pre>
* @param statusPredicate to match responses with
* @param exceptionFunction to map the response to an error signal

View File

@@ -670,7 +670,7 @@ public abstract class RouterFunctions {
* <pre class="code">
* RouterFunction&lt;ServerResponse&gt; nestedRoute =
* RouterFunctions.route()
* .nest(RequestPredicates.path("/user"), () ->
* .nest(RequestPredicates.path("/user"), () -&gt;
* RouterFunctions.route()
* .GET(this::listUsers)
* .POST(this::createUser)
@@ -695,7 +695,7 @@ public abstract class RouterFunctions {
* <pre class="code">
* RouterFunction&lt;ServerResponse&gt; nestedRoute =
* RouterFunctions.route()
* .nest(RequestPredicates.path("/user"), builder ->
* .nest(RequestPredicates.path("/user"), builder -&gt;
* builder.GET(this::listUsers)
* .POST(this::createUser))
* .build();
@@ -740,7 +740,7 @@ public abstract class RouterFunctions {
* <pre class="code">
* RouterFunction&lt;ServerResponse&gt; nestedRoute =
* RouterFunctions.route()
* .path("/user", builder ->
* .path("/user", builder -&gt;
* builder.GET(this::listUsers)
* .POST(this::createUser))
* .build();
@@ -762,7 +762,7 @@ public abstract class RouterFunctions {
* RouterFunction&lt;ServerResponse&gt; filteredRoute =
* RouterFunctions.route()
* .GET("/user", this::listUsers)
* .filter((request, next) -> {
* .filter((request, next) -&gt; {
* // check for authentication headers
* if (isAuthenticated(request)) {
* return next.handle(request);
@@ -788,7 +788,7 @@ public abstract class RouterFunctions {
* RouterFunction&lt;ServerResponse&gt; filteredRoute =
* RouterFunctions.route()
* .GET("/user", this::listUsers)
* .before(request -> {
* .before(request -&gt; {
* log(request);
* return request;
* })
@@ -809,7 +809,7 @@ public abstract class RouterFunctions {
* RouterFunction&lt;ServerResponse&gt; filteredRoute =
* RouterFunctions.route()
* .GET("/user", this::listUsers)
* .after((request, response) -> {
* .after((request, response) -&gt; {
* log(response);
* return response;
* })
@@ -829,8 +829,8 @@ public abstract class RouterFunctions {
* RouterFunction&lt;ServerResponse&gt; filteredRoute =
* RouterFunctions.route()
* .GET("/user", this::listUsers)
* .onError(e -> e instanceof IllegalStateException,
* (e, request) -> ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR).build())
* .onError(e -&gt; e instanceof IllegalStateException,
* (e, request) -&gt; ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR).build())
* .build();
* </pre>
* @param predicate the type of exception to filter
@@ -850,7 +850,7 @@ public abstract class RouterFunctions {
* RouterFunctions.route()
* .GET("/user", this::listUsers)
* .onError(IllegalStateException.class,
* (e, request) -> ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR).build())
* (e, request) -&gt; ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR).build())
* .build();
* </pre>
* @param exceptionType the type of exception to filter

View File

@@ -310,7 +310,7 @@ public interface ServerRequest {
* public Mono&lt;ServerResponse&gt; myHandleMethod(ServerRequest request) {
* Instant lastModified = // application-specific calculation
* return request.checkNotModified(lastModified)
* .switchIfEmpty(Mono.defer(() -> {
* .switchIfEmpty(Mono.defer(() -&gt; {
* // further request processing, actually building content
* return ServerResponse.ok().body(...);
* }));
@@ -344,7 +344,7 @@ public interface ServerRequest {
* public Mono&lt;ServerResponse&gt; myHandleMethod(ServerRequest request) {
* String eTag = // application-specific calculation
* return request.checkNotModified(eTag)
* .switchIfEmpty(Mono.defer(() -> {
* .switchIfEmpty(Mono.defer(() -&gt; {
* // further request processing, actually building content
* return ServerResponse.ok().body(...);
* }));
@@ -381,7 +381,7 @@ public interface ServerRequest {
* Instant lastModified = // application-specific calculation
* String eTag = // application-specific calculation
* return request.checkNotModified(lastModified, eTag)
* .switchIfEmpty(Mono.defer(() -> {
* .switchIfEmpty(Mono.defer(() -&gt; {
* // further request processing, actually building content
* return ServerResponse.ok().body(...);
* }));

View File

@@ -45,7 +45,7 @@ import org.springframework.util.PatternMatchUtils;
* specified prefix and/or suffix. Exporting an attribute that holds the
* RequestContext to all views is explicitly supported.
*
* <p>Example: prefix="templates/", suffix=".ftl", viewname="test" ->
* <p>Example: prefix="templates/", suffix=".ftl", viewname="test" &rarr;
* "templates/test.ftl"
*
* <p>As a special feature, redirect URLs can be specified via the "redirect:"

View File

@@ -45,13 +45,13 @@ import reactor.core.publisher.Mono;
* public Mono&lt;Void&gt; handle(WebSocketSession session) {
*
* Flux&lt;WebSocketMessage&gt; output = session.receive()
* .doOnNext(message -> {
* .doOnNext(message -&gt; {
* // ...
* })
* .concatMap(message -> {
* .concatMap(message -&gt; {
* // ...
* })
* .map(value -> session.textMessage("Echo " + value));
* .map(value -&gt; session.textMessage("Echo " + value));
*
* return session.send(output);
* }
@@ -68,10 +68,10 @@ import reactor.core.publisher.Mono;
* public Mono&lt;Void&gt; handle(WebSocketSession session) {
*
* Mono&lt;Void&gt; input = session.receive()
* .doOnNext(message -> {
* .doOnNext(message -&gt; {
* // ...
* })
* .concatMap(message -> {
* .concatMap(message -&gt; {
* // ...
* })
* .then();