Skip to content

Commit db9e89f

Browse files
committed
Update docs on web controller method return values
Closes gh-29349
1 parent d7d44c6 commit db9e89f

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

src/docs/asciidoc/web/webflux.adoc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,10 +1985,9 @@ generally supported for all return values.
19851985
to be written (however, `text/event-stream` must be requested or declared in the mapping
19861986
through the `produces` attribute).
19871987

1988-
| Any other return value
1989-
| If a return value is not matched to any of the above, it is, by default, treated as a view
1990-
name, if it is `String` or `void` (default view name selection applies), or as a model
1991-
attribute to be added to the model, unless it is a simple type, as determined by
1988+
| Other return values
1989+
| If a return value remains unresolved in any other way, it is treated as a model
1990+
attribute, unless it is a simple type as determined by
19921991
{api-spring-framework}/beans/BeanUtils.html#isSimpleProperty-java.lang.Class-[BeanUtils#isSimpleProperty],
19931992
in which case it remains unresolved.
19941993
|===

src/docs/asciidoc/web/webmvc.adoc

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,23 +2262,18 @@ supported for all return values.
22622262
| Write to the response `OutputStream` asynchronously. Also supported as the body of a
22632263
`ResponseEntity`. See <<mvc-ann-async>> and <<mvc-ann-async-http-streaming>>.
22642264

2265-
| Reactive types -- Reactor, RxJava, or others through `ReactiveAdapterRegistry`
2266-
| Alternative to `DeferredResult` with multi-value streams (for example, `Flux`, `Observable`)
2267-
collected to a `List`.
2268-
2269-
For streaming scenarios (for example, `text/event-stream`, `application/json+stream`),
2270-
`SseEmitter` and `ResponseBodyEmitter` are used instead, where `ServletOutputStream`
2271-
blocking I/O is performed on a Spring MVC-managed thread and back pressure is applied
2272-
against the completion of each write.
2273-
2274-
See <<mvc-ann-async>> and <<mvc-ann-async-reactive-types>>.
2275-
2276-
| Any other return value
2277-
| Any return value that does not match any of the earlier values in this table and that
2278-
is a `String` or `void` is treated as a view name (default view name selection through
2279-
`RequestToViewNameTranslator` applies), provided it is not a simple type, as determined by
2280-
{api-spring-framework}/beans/BeanUtils.html#isSimpleProperty-java.lang.Class-[BeanUtils#isSimpleProperty].
2281-
Values that are simple types remain unresolved.
2265+
| Reactor and other reactive types registered via `ReactiveAdapterRegistry`
2266+
| A single value type, e.g. `Mono`, is comparable to returning `DeferredResult`.
2267+
A multi-value type, e.g. `Flux`, may be treated as a stream depending on the requested
2268+
media type, e.g. "text/event-stream", "application/json+stream", or otherwise is
2269+
collected to a List and rendered as a single value. See <<mvc-ann-async>> and
2270+
<<mvc-ann-async-reactive-types>>.
2271+
2272+
| Other return values
2273+
| If a return value remains unresolved in any other way, it is treated as a model
2274+
attribute, unless it is a simple type as determined by
2275+
{api-spring-framework}/beans/BeanUtils.html#isSimpleProperty-java.lang.Class-[BeanUtils#isSimpleProperty],
2276+
in which case it remains unresolved.
22822277
|===
22832278

22842279

0 commit comments

Comments
 (0)