20220615 Servlet 相关的 Spring Boot 自动配置类
自动配置类
Servlet 相关的匹配的自动配置类:
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfigurationorg.springframework.boot.autoconfigure.web.embedded.EmbeddedWebServerFactoryCustomizerAutoConfigurationorg.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfigurationorg.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfigurationorg.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfigurationorg.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfigurationorg.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfigurationorg.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryAutoConfigurationorg.springframework.boot.autoconfigure.task.TaskExecutionAutoConfigurationorg.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
无关的匹配的自动配置类
org.springframework.boot.autoconfigure.aop.AopAutoConfigurationorg.springframework.boot.autoconfigure.jmx.JmxAutoConfigurationorg.springframework.boot.autoconfigure.context.LifecycleAutoConfigurationorg.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfigurationorg.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfigurationorg.springframework.boot.autoconfigure.sql.init.SqlInitializationAutoConfigurationorg.springframework.boot.autoconfigure.websocket.servlet.WebSocketServletAutoConfiguration
相关的属性类
org.springframework.boot.autoconfigure.web.servlet.WebMvcPropertiesspring.mvc
org.springframework.boot.autoconfigure.web.WebPropertiesspring.web
org.springframework.boot.autoconfigure.web.ServerPropertiesserver
org.springframework.boot.autoconfigure.web.servlet.MultipartPropertiesspring.servlet.multipart
org.springframework.boot.autoconfigure.task.TaskExecutionPropertiesspring.task.execution
自动配置类中的 @Bean
DispatcherServletAutoConfiguration
DispatcherServletAutoConfiguration.DispatcherServletConfiguration
静态内部类
引入(@Import) @Bean :
DispatcherServlet dispatcherServlet
DispatcherServletAutoConfiguration.DispatcherServletRegistrationConfiguration
静态内部类
匹配(@Condition) @Bean :
DispatcherServletRegistrationBean dispatcherServletRegistration
EmbeddedWebServerFactoryCustomizerAutoConfiguration
EmbeddedWebServerFactoryCustomizerAutoConfiguration.TomcatWebServerFactoryCustomizerConfiguration
静态内部类
匹配(@Condition) @Bean :
TomcatWebServerFactoryCustomizer tomcatWebServerFactoryCustomizer
ErrorMvcAutoConfiguration
引入(@Import) @Bean :
ErrorPageCustomizer errorPageCustomizer
静态引入(@Import) @Bean :
PreserveErrorControllerTargetClassPostProcessor preserveErrorControllerTargetClassPostProcessor
匹配(@Condition) @Bean :
DefaultErrorAttributes errorAttributesBasicErrorController basicErrorController
ErrorMvcAutoConfiguration.DefaultErrorViewResolverConfiguration
静态内部类
匹配(@Condition) @Bean :
DefaultErrorViewResolver conventionErrorViewResolver
ErrorMvcAutoConfiguration.WhitelabelErrorViewConfiguration
静态内部类
匹配(@Condition) @Bean :
@Bean(name = "error") View defaultErrorViewBeanNameViewResolver beanNameViewResolver
HttpEncodingAutoConfiguration
引入(@Import) @Bean :
LocaleCharsetMappingsCustomizer localeCharsetMappingsCustomizer
匹配(@Condition) @Bean :
CharacterEncodingFilter characterEncodingFilter
HttpMessageConvertersAutoConfiguration
匹配(@Condition) @Bean :
HttpMessageConverters messageConverters
HttpMessageConvertersAutoConfiguration.StringHttpMessageConverterConfiguration
匹配(@Condition) @Bean :
StringHttpMessageConverter stringHttpMessageConverter
JacksonHttpMessageConvertersConfiguration
引入的配置类
JacksonHttpMessageConvertersConfiguration.MappingJackson2HttpMessageConverterConfiguration
静态内部类
匹配(@Condition) @Bean :
MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter
MultipartAutoConfiguration
匹配(@Condition) @Bean :
MultipartConfigElement multipartConfigElementStandardServletMultipartResolver multipartResolver
RestTemplateAutoConfiguration
匹配(@Condition)@Lazy @Bean :
RestTemplateBuilderConfigurer restTemplateBuilderConfigurerRestTemplateBuilder restTemplateBuilder
ServletWebServerFactoryAutoConfiguration
引入(@Import) @Bean :
ServletWebServerFactoryCustomizer servletWebServerFactoryCustomizer
匹配(@Condition) @Bean :
TomcatServletWebServerFactoryCustomizer tomcatServletWebServerFactoryCustomizer
ServletWebServerFactoryAutoConfiguration.BeanPostProcessorsRegistrar
引入的 ImportBeanDefinitionRegistrar
webServerFactoryCustomizerBeanPostProcessorWebServerFactoryCustomizerBeanPostProcessor
errorPageRegistrarBeanPostProcessorErrorPageRegistrarBeanPostProcessor
ServletWebServerFactoryConfiguration.EmbeddedTomcat
引入的配置类
TomcatServletWebServerFactory tomcatServletWebServerFactory
TaskExecutionAutoConfiguration
匹配(@Condition) @Bean :
TaskExecutorBuilder taskExecutorBuilderThreadPoolTaskExecutor applicationTaskExecutor
WebMvcAutoConfiguration
匹配(@Condition) @Bean :
OrderedFormContentFilter formContentFilter
WebMvcAutoConfiguration.EnableWebMvcConfiguration
静态内部类
继承 WebMvcConfigurationSupport :这是提供 MVC Java 配置背后的配置的主类。它通常通过将 @EnableWebMvc 添加到应用程序 @Configuration 类来导入。另一种更高级的选择是直接从此类扩展并根据需要覆盖方法,记住将 @Configuration 添加到子类,将 @Bean 添加到覆盖的 @Bean 方法。
引入(@Import) @Bean :
WelcomePageHandlerMapping welcomePageHandlerMapping
引入父类 WebMvcConfigurationSupport @Bean 方法
PathPatternParser mvcPatternParserUrlPathHelper mvcUrlPathHelperPathMatcher mvcPathMatcherHandlerMapping viewControllerHandlerMappingBeanNameUrlHandlerMapping beanNameHandlerMappingRouterFunctionMapping routerFunctionMappingHandlerMapping resourceHandlerMappingResourceUrlProvider mvcResourceUrlProviderHandlerMapping defaultServletHandlerMappingHandlerFunctionAdapter handlerFunctionAdapterCompositeUriComponentsContributor mvcUriComponentsContributorHttpRequestHandlerAdapter httpRequestHandlerAdapterSimpleControllerHandlerAdapter simpleControllerHandlerAdapterHandlerExceptionResolver handlerExceptionResolverViewResolver mvcViewResolverHandlerMappingIntrospector mvcHandlerMappingIntrospectorRequestToViewNameTranslator viewNameTranslator
重写父类 WebMvcConfigurationSupport @Bean 方法
RequestMappingHandlerAdapter requestMappingHandlerAdapterRequestMappingHandlerMapping requestMappingHandlerMappingFormattingConversionService mvcConversionServiceValidator mvcValidatorContentNegotiationManager mvcContentNegotiationManagerLocaleResolver localeResolverThemeResolver themeResolverFlashMapManager flashMapManager
WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter
静态内部类
匹配(@Condition) @Bean :
InternalResourceViewResolver defaultViewResolverRequestContextFilter requestContextFilterContentNegotiatingViewResolver viewResolver
部分不匹配的配置类和 @Bean
下面存在不匹配方法的都是匹配的配置类,不存在不匹配方法的配置类都不匹配
ServletWebServerFactoryAutoConfiguration.ForwardedHeaderFilterConfigurationDispatcherServletAutoConfiguration.DispatcherServletConfigurationMultipartResolver multipartResolver
ServletWebServerFactoryConfiguration.EmbeddedJettyServletWebServerFactoryConfiguration.EmbeddedUndertowTaskSchedulingAutoConfigurationThreadPoolTaskScheduler taskScheduler
ValidationAutoConfigurationWebMvcAutoConfigurationOrderedHiddenHttpMethodFilter hiddenHttpMethodFilter
WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapterBeanNameViewResolver beanNameViewResolver
浙公网安备 33010602011771号