Merge branch '2.5.x' into 2.6.x

Closes gh-29728
This commit is contained in:
Moritz Halbritter
2022-02-10 13:28:15 +01:00
5 changed files with 107 additions and 7 deletions

View File

@@ -15,13 +15,27 @@ The following code shows a typical `@RestController` that serves JSON data:
include::{docs-java}/web/servlet/springmvc/MyRestController.java[]
----
"`WebMvc.fn`", the functional variant, separates the routing configuration from the actual handling of the requests, as shown in the following example:
[source,java,indent=0,subs="verbatim"]
----
include::{docs-java}/web/servlet/springmvc/MyRoutingConfiguration.java[]
----
[source,java,indent=0,subs="verbatim"]
----
include::{docs-java}/web/servlet/springmvc/MyUserHandler.java[]
----
Spring MVC is part of the core Spring Framework, and detailed information is available in the {spring-framework-docs}/web.html#mvc[reference documentation].
There are also several guides that cover Spring MVC available at https://spring.io/guides.
TIP: You can define as many `RouterFunction` beans as you like to modularize the definition of the router.
Beans can be ordered if you need to apply a precedence.
[[web.servlet.spring-mvc.auto-configuration]]
==== Spring MVC Auto-configuration
Spring Boot provides auto-configuration for Spring MVC that works well with most applications.
The auto-configuration adds the following features on top of Spring's defaults: