WebMvcConfigurationSupport
来源:互联网 发布:骂河南人被起诉 知乎 编辑:程序博客网 时间:2024/06/03 03:44
public class WebMvcConfigurationSupportextends Objectimplements ApplicationContextAware, ServletContextAware
This is the main class providing the configuration behind the MVC Java config. It is typically imported by adding
@EnableWebMvc
to an application @Configuration
class. An alternative more advanced option is to extend directly from this class and override methods as necessary remembering to add @Configuration
to the subclass and @Bean
to overridden @Bean
methods. For more details see the Javadoc of @EnableWebMvc
.This class registers the following HandlerMapping
s:
RequestMappingHandlerMapping
ordered at 0 for mapping requests to annotated controller methods.HandlerMapping
ordered at 1 to map URL paths directly to view names.BeanNameUrlHandlerMapping
ordered at 2 to map URL paths to controller bean names.HandlerMapping
ordered atInteger.MAX_VALUE-1
to serve static resource requests.HandlerMapping
ordered atInteger.MAX_VALUE
to forward requests to the default servlet.
Registers these HandlerAdapter
s:
RequestMappingHandlerAdapter
for processing requests with annotated controller methods.HttpRequestHandlerAdapter
for processing requests withHttpRequestHandler
s.SimpleControllerHandlerAdapter
for processing requests with interface-basedController
s.
Registers a HandlerExceptionResolverComposite
with this chain of exception resolvers:
ExceptionHandlerExceptionResolver
for handling exceptions through @ExceptionHandler
methods.ResponseStatusExceptionResolver
for exceptions annotated with @ResponseStatus
.DefaultHandlerExceptionResolver
for resolving known Spring exception types
Registers an AntPathMatcher
and a UrlPathHelper
to be used by:
- the
RequestMappingHandlerMapping
, - the
HandlerMapping
for ViewControllers - and the
HandlerMapping
for serving resources
PathMatchConfigurer
.Both the RequestMappingHandlerAdapter
and the ExceptionHandlerExceptionResolver
are configured with default instances of the following by default:
- a
ContentNegotiationManager
- a
DefaultFormattingConversionService
- a
OptionalValidatorFactoryBean
if a JSR-303 implementation is available on the classpath - a range of
HttpMessageConverter
s depending on the third-party libraries available on the classpath.
- Since:
- 3.1
0 0
- WebMvcConfigurationSupport
- @EnableWebMvc 、WebMvcConfigurationSupport和WebMvcConfigurationAdapter
- xml零配置之WebMvcConfigurationSupport
- 解析@EnableWebMvc 、WebMvcConfigurationSupport和WebMvcConfigurationAdapter
- java 方式配置spring mvc 继承WebMvcConfigurerAdapter和继承WebMvcConfigurationSupport
- 虚拟机已死,容器才是未来?
- 浅谈盒模型
- 《java入门第一季》之面向对象(匿名对象)
- php 函 数
- LeetCode 207. Course Schedule(课程安排)
- WebMvcConfigurationSupport
- 线程系列(三)--Liveness
- 233. Number of Digit One
- 为什么UDP有时比TCP更有优势?
- 112. Path Sum
- C++中注册表操作
- HDU 1010 DFS+剪枝
- eciplise android 出现导入不了layout文件的解决方法
- Emacs常用命令