@@ -3410,26 +3410,6 @@ Support for `@ExceptionHandler` methods in Spring WebFlux is provided by the
3410
3410
for more detail.
3411
3411
3412
3412
3413
- [[webflux-ann-rest-exceptions]]
3414
- ==== REST API exceptions
3415
- [.small]#<<web.adoc#mvc-ann-rest-exceptions, Web MVC>>#
3416
-
3417
- A common requirement for REST services is to include error details in the body of the
3418
- response. The Spring Framework does not automatically do so, because the representation
3419
- of error details in the response body is application-specific. However, a
3420
- `@RestController` can use `@ExceptionHandler` methods with a `ResponseEntity` return
3421
- value to set the status and the body of the response. Such methods can also be declared
3422
- in `@ControllerAdvice` classes to apply them globally.
3423
-
3424
- Applications that implement global exception handling with error details in the response
3425
- body should consider extending
3426
- {api-spring-framework}/web/reactive/result/method/annotation/ResponseEntityExceptionHandler.html[`ResponseEntityExceptionHandler`],
3427
- which provides handling for exceptions that Spring MVC raises and provides hooks to
3428
- customize the response body. To make use of this, create a subclass of
3429
- `ResponseEntityExceptionHandler`, annotate it with `@ControllerAdvice`, override the
3430
- necessary methods, and declare it as a Spring bean.
3431
-
3432
-
3433
3413
3434
3414
3435
3415
[[webflux-ann-controller-advice]]
@@ -3511,6 +3491,26 @@ include::web-uris.adoc[leveloffset=+2]
3511
3491
include::webflux-cors.adoc[leveloffset=+1]
3512
3492
3513
3493
3494
+ [[webflux-ann-rest-exceptions]]
3495
+ == REST API exceptions
3496
+ [.small]#<<web.adoc#mvc-ann-rest-exceptions, Web MVC>>#
3497
+
3498
+ A common requirement for REST services is to include error details in the body of the
3499
+ response. The Spring Framework does not automatically do so, because the representation
3500
+ of error details in the response body is application-specific. However, a
3501
+ `@RestController` can use `@ExceptionHandler` methods with a `ResponseEntity` return
3502
+ value to set the status and the body of the response. Such methods can also be declared
3503
+ in `@ControllerAdvice` classes to apply them globally.
3504
+
3505
+ Applications that implement global exception handling with error details in the response
3506
+ body should consider extending
3507
+ {api-spring-framework}/web/reactive/result/method/annotation/ResponseEntityExceptionHandler.html[`ResponseEntityExceptionHandler`],
3508
+ which provides handling for exceptions that Spring MVC raises and provides hooks to
3509
+ customize the response body. To make use of this, create a subclass of
3510
+ `ResponseEntityExceptionHandler`, annotate it with `@ControllerAdvice`, override the
3511
+ necessary methods, and declare it as a Spring bean.
3512
+
3513
+
3514
3514
3515
3515
3516
3516
[[webflux-web-security]]
@@ -3526,8 +3526,6 @@ reference documentation, including:
3526
3526
* {doc-spring-security}/features/exploits/csrf.html#csrf-protection[CSRF protection]
3527
3527
* {doc-spring-security}/features/exploits/headers.html[Security Response Headers]
3528
3528
3529
- include::webflux-view.adoc[leveloffset=+1]
3530
-
3531
3529
3532
3530
3533
3531
@@ -3700,6 +3698,7 @@ You should serve static resources with a `Cache-Control` and conditional respons
3700
3698
for optimal performance. See the section on configuring <<webflux-config-static-resources>>.
3701
3699
3702
3700
3701
+ include::webflux-view.adoc[leveloffset=+1]
3703
3702
3704
3703
3705
3704
[[webflux-config]]
0 commit comments