配置文件中有个属性是,这个属性就是保证spring可以识别注解,它包含下面4个解析器
AutowiredAnnotionBeanPostProcessor
CommonAnnotationBeanPostProcessor
PersistenceAnnotionBeanPostProcessor
RequiredAnnotationBeanPostProcessor.
而实际上大部分时候用的是,就是自动扫描包下面的类是否包含注解,如果有就注入,有这个配置后,annotation-config可以不要了
本文介绍了 Spring 中用于处理注解的四个主要 BeanPostProcessor:AutowiredAnnotionBeanPostProcessor、CommonAnnotationBeanPostProcessor、PersistenceAnnotionBeanPostProcessor 和 RequiredAnnotationBeanPostProcessor。此外还讨论了如何使用自动扫描功能来替代 annotation-config 的配置。
165

被折叠的 条评论
为什么被折叠?



