Web MVC Config

应用程序可以声明 Special Bean Types 中列出的基础结构 Bean,这些 Bean 是处理请求所必需的。DispatcherServlet 会针对每个特殊 Bean 检查 WebApplicationContext。如果没有匹配的 Bean 类型,它将回退到 DispatcherServlet.properties 中列出的默认类型。

Applications can declare the infrastructure beans listed in Special Bean Types that are required to process requests. The DispatcherServlet checks the WebApplicationContext for each special bean. If there are no matching bean types, it falls back on the default types listed in DispatcherServlet.properties.

在大多数情况下,MVC Config 是最佳的起点。它会在 Java 或 XML 中声明所需 Bean,并提供了高级别的配置回调 API 来对它进行自定义。

In most cases, the MVC Config is the best starting point. It declares the required beans in either Java or XML and provides a higher-level configuration callback API to customize it.

Spring Boot 依赖于 MVC Java 配置来配置 Spring MVC,并提供了许多额外便利选项。

Spring Boot relies on the MVC Java configuration to configure Spring MVC and provides many extra convenient options.