Update docs on web controller method return values
Closes gh-29349
This commit is contained in:
parent
d7d44c6c51
commit
db9e89fba9
|
|
@ -1985,10 +1985,9 @@ generally supported for all return values.
|
|||
to be written (however, `text/event-stream` must be requested or declared in the mapping
|
||||
through the `produces` attribute).
|
||||
|
||||
| Any other return value
|
||||
| If a return value is not matched to any of the above, it is, by default, treated as a view
|
||||
name, if it is `String` or `void` (default view name selection applies), or as a model
|
||||
attribute to be added to the model, unless it is a simple type, as determined by
|
||||
| Other return values
|
||||
| If a return value remains unresolved in any other way, it is treated as a model
|
||||
attribute, unless it is a simple type as determined by
|
||||
{api-spring-framework}/beans/BeanUtils.html#isSimpleProperty-java.lang.Class-[BeanUtils#isSimpleProperty],
|
||||
in which case it remains unresolved.
|
||||
|===
|
||||
|
|
|
|||
|
|
@ -2262,23 +2262,18 @@ supported for all return values.
|
|||
| Write to the response `OutputStream` asynchronously. Also supported as the body of a
|
||||
`ResponseEntity`. See <<mvc-ann-async>> and <<mvc-ann-async-http-streaming>>.
|
||||
|
||||
| Reactive types -- Reactor, RxJava, or others through `ReactiveAdapterRegistry`
|
||||
| Alternative to `DeferredResult` with multi-value streams (for example, `Flux`, `Observable`)
|
||||
collected to a `List`.
|
||||
| Reactor and other reactive types registered via `ReactiveAdapterRegistry`
|
||||
| A single value type, e.g. `Mono`, is comparable to returning `DeferredResult`.
|
||||
A multi-value type, e.g. `Flux`, may be treated as a stream depending on the requested
|
||||
media type, e.g. "text/event-stream", "application/json+stream", or otherwise is
|
||||
collected to a List and rendered as a single value. See <<mvc-ann-async>> and
|
||||
<<mvc-ann-async-reactive-types>>.
|
||||
|
||||
For streaming scenarios (for example, `text/event-stream`, `application/json+stream`),
|
||||
`SseEmitter` and `ResponseBodyEmitter` are used instead, where `ServletOutputStream`
|
||||
blocking I/O is performed on a Spring MVC-managed thread and back pressure is applied
|
||||
against the completion of each write.
|
||||
|
||||
See <<mvc-ann-async>> and <<mvc-ann-async-reactive-types>>.
|
||||
|
||||
| Any other return value
|
||||
| Any return value that does not match any of the earlier values in this table and that
|
||||
is a `String` or `void` is treated as a view name (default view name selection through
|
||||
`RequestToViewNameTranslator` applies), provided it is not a simple type, as determined by
|
||||
{api-spring-framework}/beans/BeanUtils.html#isSimpleProperty-java.lang.Class-[BeanUtils#isSimpleProperty].
|
||||
Values that are simple types remain unresolved.
|
||||
| Other return values
|
||||
| If a return value remains unresolved in any other way, it is treated as a model
|
||||
attribute, unless it is a simple type as determined by
|
||||
{api-spring-framework}/beans/BeanUtils.html#isSimpleProperty-java.lang.Class-[BeanUtils#isSimpleProperty],
|
||||
in which case it remains unresolved.
|
||||
|===
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue