Browse Source

Polishing contribution

Closes gh-34554
pull/35405/head
rstoyanchev 8 months ago
parent
commit
de52090959
  1. 6
      framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/return-types.adoc
  2. 8
      framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-exceptionhandler.adoc
  3. 6
      framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/return-types.adoc
  4. 14
      spring-web/src/main/java/org/springframework/web/bind/annotation/ExceptionHandler.java

6
framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/return-types.adoc

@ -34,11 +34,7 @@ Controllers can then return a `Flux<List<B>>`; Reactor provides a dedicated oper @@ -34,11 +34,7 @@ Controllers can then return a `Flux<List<B>>`; Reactor provides a dedicated oper
| `HttpHeaders`
| For returning a response with headers and no body.
| `ErrorResponse`
| To render an RFC 9457 error response with details in the body,
see xref:web/webflux/ann-rest-exceptions.adoc[Error Responses]
| `ProblemDetail`
| `ErrorResponse`, `ProblemDetail`
| To render an RFC 9457 error response with details in the body,
see xref:web/webflux/ann-rest-exceptions.adoc[Error Responses]

8
framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-exceptionhandler.adoc

@ -177,13 +177,9 @@ the content negotiation during the error handling phase will decide which conten @@ -177,13 +177,9 @@ the content negotiation during the error handling phase will decide which conten
be converted through `HttpMessageConverter` instances and written to the response.
See xref:web/webmvc/mvc-controller/ann-methods/responseentity.adoc[ResponseEntity].
| `ErrorResponse`
| `ErrorResponse`, `ProblemDetail`
| To render an RFC 9457 error response with details in the body,
see xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses]
| `ProblemDetail`
| To render an RFC 9457 error response with details in the body,
see xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses]
see xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses]
| `String`
| A view name to be resolved with `ViewResolver` implementations and used together with the

6
framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/return-types.adoc

@ -22,11 +22,7 @@ supported for all return values. @@ -22,11 +22,7 @@ supported for all return values.
| `HttpHeaders`
| For returning a response with headers and no body.
| `ErrorResponse`
| To render an RFC 9457 error response with details in the body,
see xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses]
| `ProblemDetail`
| `ErrorResponse`, `ProblemDetail`
| To render an RFC 9457 error response with details in the body,
see xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses]

14
spring-web/src/main/java/org/springframework/web/bind/annotation/ExceptionHandler.java

@ -71,24 +71,24 @@ import org.springframework.core.annotation.AliasFor; @@ -71,24 +71,24 @@ import org.springframework.core.annotation.AliasFor;
*
* <p>The following return types are supported for handler methods:
* <ul>
* <li>A {@code ModelAndView} object (from Servlet MVC).
* <li>A {@link org.springframework.ui.Model} object, with the view name implicitly
* <li>{@code ModelAndView} object (from Servlet MVC).
* <li>{@link org.springframework.ui.Model} object, with the view name implicitly
* determined through a {@link org.springframework.web.servlet.RequestToViewNameTranslator}.
* <li>A {@link java.util.Map} object for exposing a model,
* <li>{@link java.util.Map} object for exposing a model,
* with the view name implicitly determined through a
* {@link org.springframework.web.servlet.RequestToViewNameTranslator}.
* <li>A {@link org.springframework.web.servlet.View} object.
* <li>A {@link String} value which is interpreted as view name.
* <li>{@link org.springframework.web.servlet.View} object.
* <li>{@link String} value which is interpreted as view name.
* <li>{@link ResponseBody @ResponseBody} annotated methods (Servlet-only)
* to set the response content. The return value will be converted to the
* response stream using
* {@linkplain org.springframework.http.converter.HttpMessageConverter message converters}.
* <li>An {@link org.springframework.http.HttpEntity HttpEntity&lt;?&gt;} or
* <li>{@link org.springframework.http.HttpEntity HttpEntity&lt;?&gt;} or
* {@link org.springframework.http.ResponseEntity ResponseEntity&lt;?&gt;} object
* (Servlet-only) to set response headers and content. The ResponseEntity body
* will be converted and written to the response stream using
* {@linkplain org.springframework.http.converter.HttpMessageConverter message converters}.
* <li>A {@link org.springframework.http.ProblemDetail} or {@link org.springframework.web.ErrorResponse}
* <li>{@link org.springframework.http.ProblemDetail} or {@link org.springframework.web.ErrorResponse}
* object to render an RFC 9457 error response with details in the body.
* <li>{@code void} if the method handles the response itself (by
* writing the response content directly, declaring an argument of type

Loading…
Cancel
Save