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:
● Inclusion of ContentNegotiatingViewResolver and BeanNameViewResolver beans.
○ 内容协商视图解析器和BeanName视图解析器
● Support for serving static resources, including support for WebJars (covered later in this document)).
○ 静态资源(包括webjars)
● Automatic registration of Converter, GenericConverter, and Formatter beans.
○ 自动注册 Converter,GenericConverter,Formatter
● Support for HttpMessageConverters (covered later in this document).
○ 支持 HttpMessageConverters (后来我们配合内容协商理解原理)
● Automatic registration of MessageCodesResolver (covered later in this document).
○ 自动注册 MessageCodesResolver (国际化用)
● Static index.html support.
○ 静态index.html 页支持
● Custom Favicon support (covered later in this document).
○ 自定义 Favicon
● Automatic use of a ConfigurableWebBindingInitializer bean (covered later in this document).
○ 自动使用 ConfigurableWebBindingInitializer ,(DataBinder负责将请求数据绑定到JavaBean上)
If you want to keep those Spring Boot MVC customizations and make more MVC customizations (interceptors, formatters, view controllers, and other features), you can add your own @Configuration class of type WebMvcConfigurer but without @EnableWebMvc.
不用@EnableWebMvc注解。使用 @Configuration + WebMvcConfigurer 自定义规则

If you want to provide custom instances of
RequestMappingHandlerMapping, RequestMappingHandlerAdapter, or
ExceptionHandlerExceptionResolver, and still keep the Spring Boot MVC
customizations, you can declare a bean of type WebMvcRegistrations and
use it to provide custom instances of those components. 声明
WebMvcRegistrations 改变默认底层组件

If you want to take complete control of Spring MVC, you can add your
own @Configuration annotated with @EnableWebMvc, or alternatively add
your own @Configuration-annotated DelegatingWebMvcConfiguration as
described in the Javadoc of @EnableWebMvc. 使用
@EnableWebMvc+@Configuration+DelegatingWebMvcConfiguration
全面接管SpringMVC

[SpringBoot2]web场景_SpringBoot2_SpringMVC自动配置概览相关推荐

  1. 5、SpringMVC自动配置概览

    1.SpringMVC自动配置概览 Spring Boot provides auto-configuration for Spring MVC that works well with most a ...

  2. [SpringBoot2]数据访问_数据库场景的自动配置分析和整合测试

    数据访问 1.导入jdbc场景 <dependency><groupId>org.springframework.boot</groupId><artifac ...

  3. 注解不自动导包_玩转SpringBoot2.X:SpringBoot自动配置原理大揭秘

    我们在使用SpringBoot的时候,是不是觉得特方便,根本不需要我们去配置什么端口号,应用名称,又比如我们再整合redis的时候,其实也不需要我们去指定端口号,IP,都会有默认的.是不是特方便.那么 ...

  4. [SpringBoot2]web场景_静态资源规则与定制化

    静态资源目录 只要静态资源放在类路径下: called /static (or /public or /resources or /META-INF/resources 访问 : 当前项目根路径/ + ...

  5. [SpringBoot2]自动配置

    自动配置 ● 自动配好Tomcat 引入Tomcat依赖. 配置Tomcat <dependency><groupId>org.springframework.boot< ...

  6. 2、SpringBoot2组件添加注解与自动配置原理

    1.组件添加 (1)@Configuration + @Bean 通过配置类往容器中添加组件,@Bean用于配置类的方法上 /** * 1.配置类里面使用@Bean标注在方法上给容器注册组件,默认也是 ...

  7. SpringBoot_web开发-SpringMVC自动配置原理

    我们自己分析Springboot的源码,里面有什么功能,第二个我们来参照官方文档,官方文档里面写了什么功能,我们看官方文档告诉我们自动配置了哪些,再来带大家来翻一翻源码,希望通过这一次的分析,后来的模 ...

  8. Springboot自动配置原理入门

    1.引导加载自动配置类 @SpringBootApplication注解相当于@SpringBootConfiguration.@EnableAutoConfiguration和@ComponentS ...

  9. Spring Boot(1) 入门、自动配置

    Hello,Spring Boot 1.创建一个普通的maven项目 2.pom.xml引入依赖 <parent><groupId>org.springframework.bo ...

最新文章

  1. 使用tcgetattr函数与tcsetattr函数控制终端
  2. 大用户规模互联网架构发展
  3. python 解析XML xml.dom
  4. gcc命令-更新中....
  5. Java笔记-Spring中RabbitMQ的调用
  6. 随笔编号-03 基本类型相互转换集合
  7. Spring Cloud教程 (二)应用程序上下文服务层次结构
  8. 解决hbase客服端连接服务端不报错就是一直连不上的问题
  9. Unity Shader-GodRay,体积光(BillBoard,Volume Shadow,Raidal Blur,Ray-Marching)
  10. 367. 有效的完全平方数【我亦无他唯手熟尔】
  11. 2021-11-12:前 K 个高频元素。给你一个整数数组 nums 和一个整数 k ,请你返回其中出现频率前 k 高的元素。你可以按 任意顺序 返回答案。提示:1 <= nums.length <=
  12. 洛谷P1510-精卫填海(01背包)
  13. C#语言实例源码系列-远程关闭和重启计算机
  14. echarts自定义X轴、Y轴间距
  15. Lambda表达式超详细总结
  16. Qt之QML虚拟键盘
  17. 1wifi 简介(框架)2系统启动后的 wifi加载 过程-图解 3系统启动后的 wifi 加载过程
  18. 三分钟学会怎样识别手写文字
  19. 不会PS如何快速得到自己想要的图片——iOS图标启动图生成器
  20. python操作句柄_python句柄部分操作

热门文章

  1. 用python将指定目录下的所有json文件合并成一个csv文件
  2. 原生js声音播放代码
  3. 西北师范大学地理与环境科学学院考研真题汇总(自然地理学)持续更新。。。
  4. 【重磅】ArcGIS 10.8手把手经典图文安装教程(附安装包全套装下载,亲测可用)
  5. 从listView1中选择记录到listView2中
  6. Android之android8.1打开热点提示UID 10140 does not have Location permission和Location mode is enabled.
  7. 剑指offer之二叉搜索树和双向链表
  8. linux之写C代码出现warning: format not a string literal and no format arguments [-Wformat-security]
  9. C++之char*,const char*和string的相互转换
  10. 网页版消消乐快速实现,无代码吗iVX 真那么简单?