@@ -2560,20 +2560,23 @@ See <<mvc-ann-jackson>> for details.
2560
2560
==== ResponseEntity
2561
2561
[.small]#<<web-reactive.adoc#webflux-ann-responseentity,Same in Spring WebFlux>>#
2562
2562
2563
- `ResponseEntity` is more or less identical to using <<mvc-ann-responsebody>> but based
2564
- on a container object that specifies request headers and body. Below is an example:
2563
+ `ResponseEntity` is like <<mvc-ann-responsebody>> but with status and headers. For example:
2565
2564
2566
2565
[source,java,indent=0]
2567
2566
[subs="verbatim,quotes"]
2568
2567
----
2569
- @PostMapping ("/something")
2568
+ @GetMapping ("/something")
2570
2569
public ResponseEntity<String> handle() {
2571
- // ...
2572
- URI location = ... ;
2573
- return ResponseEntity.created(location). build();
2570
+ String body = ... ;
2571
+ String etag = ... ;
2572
+ return ResponseEntity.ok().eTag(etag). build(body );
2574
2573
}
2575
2574
----
2576
2575
2576
+ Spring MVC supports using a single value <<mvc-ann-async-reactive-types,reactive type>>
2577
+ to produce the `ResponseEntity` asynchronously, and/or single and multi-value reactive
2578
+ types for the body.
2579
+
2577
2580
2578
2581
[[mvc-ann-jackson]]
2579
2582
==== Jackson JSON
@@ -3617,10 +3620,11 @@ customize the status and headers of the response.
3617
3620
=== Reactive types
3618
3621
[.small]#<<web-reactive.adoc#webflux-codecs-streaming,Same in Spring WebFlux>>#
3619
3622
3620
- Spring MVC supports use of reactive client libraries in a controller. This includes the
3621
- `WebClient` from `spring-webflux` and others such as Spring Data reactive data
3622
- repositories. In such scenarios it is convenient to be able to return reactive types
3623
- from the controller method .
3623
+ Spring MVC supports use of reactive client libraries in a controller (also read
3624
+ <<web-reactive.adoc#webflux-reactive-libraries,Reactive Libraries>> in the WebFlux section).
3625
+ This includes the `WebClient` from `spring-webflux` and others, such as Spring Data
3626
+ reactive data repositories. In such scenarios, it is convenient to be able to return
3627
+ reactive types from the controller method.
3624
3628
3625
3629
Reactive return values are handled as follows:
3626
3630
0 commit comments