@SpringBootApplication
2020-06-22 13:59:00   20  举报             
     
         
 AI智能生成
  @SpringBootApplication注解说明
    作者其他创作
 大纲/内容
  @SpringBootConfiguration    
     就是@Configuration的另一种写法  
     @EnableAutoConfiguration(自动装配)    
     注解    
     @AutoConfigurationPackage    
     @Import(AutoConfigurationPackages.Registrar.class)    
     注册一个代表根包的Bean  
     @Import(AutoConfigurationImportSelector.class)  
     机制    
     SpringFactoriesLoader.loadFactoryNames    
     获取META-INF/spring.factories下的EnableAutoConfiguration  
     @ComponentScan    
     有两个特殊的filter    
     TypeExcludeFilter    
     提供一种扩展机制,能让我们向IOC容器中注册一些自定义的组件过滤器,以在包扫描的过程中过滤它们  
     AutoConfigurationExcludeFilter  
     Spring(手动装配)    
     @Component  
     @Configuration&@Bean  
     @EnableXXX    
     配合@Import    
     导入普通类    
     直接把对应的类变成Bean注册到容器中  
     导入配置类    
     把该配置下的所有@Bean注册到容器中  
     导入ImportSelector实现类    
     实现selectImports,返回的数组就是Bean信息(类的全称)  
     导入@ImportBeanDefinitionRegistrar    
     实现registerBeanDefinitions,自己指定beanName和BeanDefinition实现  
     @WebMvcAutoConfiguration    
     EnableWebMvcConfiguration    
     WelcomePageHandlerMapping  
     RequestMappingHandlerAdapter  
     RequestMappingHandlerMapping  
     Validator  
     全局异常处理器  
     WebMvcAutoConfigurationAdapter    
      ViewResolver的组件注册    
     InternalResourceViewResolver  
     BeanNameViewResolver  
     ContentNegotiatingViewResolver
  
     LocaleResolver  
     HttpMessageConverter  
     静态资源映射  
     主页的设置  
     应用图标配置  
     @DispatcherServletAutoConfiguration    
     DispatcherServletConfiguration    
     DispatcherServlet  
     MultipartResolver  
     DispatcherServletRegistrationConfiguration    
     DispatcherServletRegistrationBean  
     @ServletWebServerFactoryAutoConfiguration    
     BeanPostProcessorsRegistrar    
     WebServerFactoryCustomizerBeanPostProcessor    
     ServletWebServerFactoryCustomizer  
     TomcatServletWebServerFactoryCustomizer  
     ErrorPageRegistrarBeanPostProcessor  
     EmbeddedTomcat  
     EmbeddedJetty  
     EmbeddedUndertow  
     
    收藏 
     
 
 
 
 
  0 条评论
 下一页
  
   
  
  
  
  
  
  
  
  
  
  
 