ResponseEntityExceptionHandler rethrows unknown exception (for further processing in DispatcherServlet's HandlerExceptionResolver chain)

Issue: SPR-16743

(cherry picked from commit 7b894fe)
This commit is contained in:
Juergen Hoeller
2018-05-05 12:46:58 +02:00
parent a0d37ac29e
commit ed44262a71
6 changed files with 188 additions and 108 deletions

View File

@@ -207,7 +207,7 @@ Maven or Gradle dependencies. Spring Boot defaults to Netty because it is more w
used in the async, non-blocking space, and provides a client and a server share resources.
Tomcat and Jetty can be used with both Spring MVC and WebFlux. Keep in mind however that
the way they're used is very differently. Spring MVC relies on Servlet blocking I/O and
the way they're used is very different. Spring MVC relies on Servlet blocking I/O and
allows applications to use the Servlet API directly if they need to. Spring WebFlux
relies on Servlet 3.1 non-blocking I/O and uses the Servlet API behind a low-level
adapter and not exposed for direct use.
@@ -2448,8 +2448,8 @@ in `@ControllerAdvice` classes to apply them globally.
====
Note that Spring WebFlux does not have an equivalent for the Spring MVC
`ResponseEntityExceptionHandler` because WebFlux only raises `ResponseStatusException`
(or sub-classes of), which and those do not need to be translated translation to an HTTP
status code.
(or subclasses thereof), which and those do not need to be translated translation to
an HTTP status code.
====

View File

@@ -2977,7 +2977,7 @@ Applications that implement global exception handling with error details in the
body should consider extending
{api-spring-framework}/web/servlet/mvc/method/annotation/ResponseEntityExceptionHandler.html[ResponseEntityExceptionHandler]
which provides handling for exceptions that Spring MVC raises along with hooks to
customize the response body. To make use of this, create a sub-class of
customize the response body. To make use of this, create a subclass of
`ResponseEntityExceptionHandler`, annotate with `@ControllerAdvice`, override the
necessary methods, and declare it as a Spring bean.