<context annotation-config />简介
2017-04-01 14:52
267 查看
该标签隐式的向Spring容器注册了:
AutowiredAnnotationBeanPostProcessor
CommondAnnotationBeanPostProcessor
PersistenceAnnotationBeanPostProcessor
RequiredAnnotationBeanPostProcessor
这四个BeanPostProcessor.
1.AutowiredAnnotationBeanPostProcessor:主要是使用@AutoWired注解时,必须提前向Spring容器注册这个BeanPostprocessor
2.CommondAnnotationBeanPostprocessor:主要是使用@Resource、@PostConstruct、@Predestory等注解时,必须提前向Spring容器注册。
3.PersistenceAnnotationBeanPostProcessor :主要是使用@PersistenceContext注解时,必须提前向Spring容器注册。
4.RequiredAnnotationBeanPostProcessor:主要是使用@Required注解时,必须提前向Spring容器注册。
使用注解,一般都会配置扫描包路径:<context: component-scan base-package=com.xxx.xxx />,
配置了包扫描之后,<context annotation-config /> 可以移除。
AutowiredAnnotationBeanPostProcessor
CommondAnnotationBeanPostProcessor
PersistenceAnnotationBeanPostProcessor
RequiredAnnotationBeanPostProcessor
这四个BeanPostProcessor.
1.AutowiredAnnotationBeanPostProcessor:主要是使用@AutoWired注解时,必须提前向Spring容器注册这个BeanPostprocessor
2.CommondAnnotationBeanPostprocessor:主要是使用@Resource、@PostConstruct、@Predestory等注解时,必须提前向Spring容器注册。
3.PersistenceAnnotationBeanPostProcessor :主要是使用@PersistenceContext注解时,必须提前向Spring容器注册。
4.RequiredAnnotationBeanPostProcessor:主要是使用@Required注解时,必须提前向Spring容器注册。
使用注解,一般都会配置扫描包路径:<context: component-scan base-package=com.xxx.xxx />,
配置了包扫描之后,<context annotation-config /> 可以移除。
相关文章推荐
- spring配置文件中的<context:annotation-config/>
- Spring注解之xml配置中的<context:component-scan />和<context:annotation-config/>
- <context:annotation-config/>,<mvc:annotation-driven/>和<context:component-scan>之间的关
- 关于Spring中的<context:annotation-config/>配置
- Spring中的<context:annotation-config/>配置
- <context annotation-config />标签意义:
- <context:annotation-config/>
- 关于Spring中的<context:annotation-config/>配置
- <context:annotation-config/>,<mvc:annotation-driven/>和<context:component-scan>之间的关系
- <context annotation-config />标签意义
- Spring配置文件详解一:<context:annotation-config/>与<context:component-scan base-package="com.xx
- Spring <context:annotation-config/> <context:component-scan/>与<mvc:annotation-driven />
- 关于Spring中的<context:annotation-config/>配置
- 关于Spring中的<context:annotation-config/>配置
- 关于Spring的<context:annotation-config/>配置详解
- <mvc:annotation-driven/>与<context:annotation-config/>的区别
- <context annotation-config />
- <context:annotation-config />
- <context:annotation-config/>,<mvc:annotation-driven/>和<context:component-scan>之间的关系
- <mvc:annotation-driven/> <context:annotation-config/> <context:component-scan>