@ResponseBody spring-doc.cn
|
The return value is converted through HttpMessageConverter implementations and written to the
response. See @ResponseBody .spring-doc.cn |
HttpEntity<B> , ResponseEntity<B> spring-doc.cn
|
The return value that specifies the full response (including HTTP headers and body) is to be converted
through HttpMessageConverter implementations and written to the response.
See ResponseEntity.spring-doc.cn |
HttpHeaders spring-doc.cn
|
For returning a response with headers and no body.spring-doc.cn |
ErrorResponse spring-doc.cn
|
To render an RFC 9457 error response with details in the body,
see Error Responsesspring-doc.cn |
ProblemDetail spring-doc.cn
|
To render an RFC 9457 error response with details in the body,
see Error Responsesspring-doc.cn |
String spring-doc.cn
|
A view name to be resolved with ViewResolver implementations and used together with the implicit
model — determined through command objects and @ModelAttribute methods. The handler
method can also programmatically enrich the model by declaring a Model argument
(see Explicit Registrations).spring-doc.cn |
View spring-doc.cn
|
A View instance to use for rendering together with the implicit model — determined
through command objects and @ModelAttribute methods. The handler method can also
programmatically enrich the model by declaring a Model argument
(see Explicit Registrations).spring-doc.cn |
java.util.Map , org.springframework.ui.Model spring-doc.cn
|
Attributes to be added to the implicit model, with the view name implicitly determined
through a RequestToViewNameTranslator .spring-doc.cn |
@ModelAttribute spring-doc.cn
|
An attribute to be added to the model, with the view name implicitly determined through
a RequestToViewNameTranslator .spring-doc.cn
Note that @ModelAttribute is optional. See "Any other return value" at the end of
this table.spring-doc.cn |
ModelAndView objectspring-doc.cn
|
The view and model attributes to use and, optionally, a response status.spring-doc.cn |
void spring-doc.cn
|
A method with a void return type (or null return value) is considered to have fully
handled the response if it also has a ServletResponse , an OutputStream argument, or
an @ResponseStatus annotation. The same is also true if the controller has made a positive
ETag or lastModified timestamp check (see Controllers for details).spring-doc.cn
If none of the above is true, a void return type can also indicate “no response body” for
REST controllers or a default view name selection for HTML controllers.spring-doc.cn |
DeferredResult<V> spring-doc.cn
|
Produce any of the preceding return values asynchronously from any thread — for example, as a
result of some event or callback. See Asynchronous Requests and DeferredResult .spring-doc.cn |
Callable<V> spring-doc.cn
|
Produce any of the above return values asynchronously in a Spring MVC-managed thread.
See Asynchronous Requests and Callable .spring-doc.cn |
ListenableFuture<V> ,
java.util.concurrent.CompletionStage<V> ,
java.util.concurrent.CompletableFuture<V> spring-doc.cn
|
Alternative to DeferredResult , as a convenience (for example, when an underlying service
returns one of those).spring-doc.cn |
ResponseBodyEmitter , SseEmitter spring-doc.cn
|
Emit a stream of objects asynchronously to be written to the response with
HttpMessageConverter implementations. Also supported as the body of a ResponseEntity .
See Asynchronous Requests and HTTP Streaming.spring-doc.cn |
StreamingResponseBody spring-doc.cn
|
Write to the response OutputStream asynchronously. Also supported as the body of a
ResponseEntity . See Asynchronous Requests and HTTP Streaming.spring-doc.cn |
Reactor and other reactive types registered via ReactiveAdapterRegistry spring-doc.cn |
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 Asynchronous Requests and
Reactive Types.spring-doc.cn |
Other return valuesspring-doc.cn |
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
BeanUtils#isSimpleProperty,
in which case it remains unresolved.spring-doc.cn |