【spring boot】第6篇:spring boot 对 spring mvc 的支持

spring mvc 自动配置
spring boot 启动时会对 spring mvc 做自动配置,默认的配置功能在 org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration 中进行了说明。有以下功能:

包含 ContentNegotiatingViewResolver 和 BeanNameViewResolver

ContentNegotiatingViewResolver
BeanNameViewResolver

支持对静态资源

自动注册Converter,GenericConverter和Formatter

Converter
GenericConverter
Formatter

Support for HttpMessageConverters (covered later in this document).
自动注册MessageCodesResolver

支持静态欢迎首页index.html
支持自定义 favicon 图标
自动使用ConfigurableWebBindingInitializer

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理