From a3a94950f61e2dfd1078a4b9e57628889b06d07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Basl=C3=A9?= Date: Thu, 15 Dec 2022 15:15:28 +0100 Subject: [PATCH] Rework linking to Spring MVC Async support vs WebFlux section The link was previously named "Compared to WebFlux", which is easy to mix up with the various links to equivalent sections in the WebFlux chapter. Here the links point to a small section comparing the Servlet Async API to the WebFlux stack from a high perspective. In this commit we eliminate most of these links, except at the beginning of the Asynchronous section. We also add a small mention of the Servlet configuration in the comparison paragraphs, since the Configuring section is the one furthest from the comparison paragraphs that used to have a link to it. Closes gh-29694 --- framework-docs/src/docs/asciidoc/web/webmvc.adoc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/framework-docs/src/docs/asciidoc/web/webmvc.adoc b/framework-docs/src/docs/asciidoc/web/webmvc.adoc index 46c2435b651..be84a97bfd3 100644 --- a/framework-docs/src/docs/asciidoc/web/webmvc.adoc +++ b/framework-docs/src/docs/asciidoc/web/webmvc.adoc @@ -4366,7 +4366,6 @@ capital letters of the class and the method name (for example, the `getThing` me [[mvc-ann-async]] == Asynchronous Requests -[.small]#<># Spring MVC has an extensive integration with Servlet asynchronous request <>: @@ -4379,11 +4378,10 @@ return value. * Controllers can use reactive clients and return <> for response handling. - +For an overview of how this differs from Spring WebFlux, see the <> section below. [[mvc-ann-async-deferredresult]] === `DeferredResult` -[.small]#<># Once the asynchronous request processing feature is <> in the Servlet container, controller methods can wrap any supported controller method @@ -4425,7 +4423,6 @@ example, in response to an external event (JMS message), a scheduled task, or ot [[mvc-ann-async-callable]] === `Callable` -[.small]#<># A controller can wrap any supported return value with `java.util.concurrent.Callable`, as the following example shows: @@ -4455,7 +4452,6 @@ The return value can then be obtained by running the given task through the [[mvc-ann-async-processing]] === Processing -[.small]#<># Here is a very concise overview of Servlet asynchronous request processing: @@ -4533,7 +4529,7 @@ methods for timeout and completion callbacks. [[mvc-ann-async-vs-webflux]] -==== Compared to WebFlux +==== Async Spring MVC compared to WebFlux The Servlet API was originally built for making a single pass through the Filter-Servlet chain. Asynchronous request processing lets applications exit the Filter-Servlet chain @@ -4560,6 +4556,8 @@ types in controller method arguments (for example, `@RequestBody`, `@RequestPart nor does it have any explicit support for asynchronous and reactive types as model attributes. Spring WebFlux does support all that. +Finally, from a configuration perspective the asynchronous request processing feature must be +<>. [[mvc-ann-async-http-streaming]] @@ -4809,7 +4807,6 @@ that have a built-in heartbeat mechanism. [[mvc-ann-async-configuration]] === Configuration -[.small]#<># The asynchronous request processing feature must be enabled at the Servlet container level. The MVC configuration also exposes several options for asynchronous requests.