@@ -2789,22 +2789,26 @@ See <<mvc-ann-jackson>> for details.
2789
2789
==== ResponseEntity
2790
2790
[.small]#<<web-reactive.adoc#webflux-ann-responseentity,Same as in Spring WebFlux>>#
2791
2791
2792
- `ResponseEntity` is more or less identical to using <<mvc-ann-responsebody>> but is based
2793
- on a container object that specifies request headers and body. The following listing shows an example:
2792
+ `ResponseEntity` is like <<mvc-ann-responsebody>> but with status and headers. For example:
2794
2793
2795
2794
====
2796
2795
[source,java,indent=0]
2797
2796
[subs="verbatim,quotes"]
2798
2797
----
2799
- @PostMapping ("/something")
2798
+ @GetMapping ("/something")
2800
2799
public ResponseEntity<String> handle() {
2801
- // ...
2802
- URI location = ... ;
2803
- return ResponseEntity.created(location). build();
2800
+ String body = ... ;
2801
+ String etag = ... ;
2802
+ return ResponseEntity.ok().eTag(etag). build(body );
2804
2803
}
2805
2804
----
2806
2805
====
2807
2806
2807
+ Spring MVC supports using a single value <<mvc-ann-async-reactive-types,reactive type>>
2808
+ to produce the `ResponseEntity` asynchronously, and/or single and multi-value reactive
2809
+ types for the body.
2810
+
2811
+
2808
2812
2809
2813
2810
2814
[[mvc-ann-jackson]]
@@ -3854,10 +3858,11 @@ customize the status and headers of the response.
3854
3858
=== Reactive Types
3855
3859
[.small]#<<web-reactive.adoc#webflux-codecs-streaming,Same as in Spring WebFlux>>#
3856
3860
3857
- Spring MVC supports use of reactive client libraries in a controller. This includes the
3858
- `WebClient` from `spring-webflux` and others, such as Spring Data reactive data
3859
- repositories. In such scenarios, it is convenient to be able to return reactive types
3860
- from the controller method .
3861
+ Spring MVC supports use of reactive client libraries in a controller (also read
3862
+ <<web-reactive.adoc#webflux-reactive-libraries,Reactive Libraries>> in the WebFlux section).
3863
+ This includes the `WebClient` from `spring-webflux` and others, such as Spring Data
3864
+ reactive data repositories. In such scenarios, it is convenient to be able to return
3865
+ reactive types from the controller method.
3861
3866
3862
3867
Reactive return values are handled as follows:
3863
3868
0 commit comments