1,@PropertySource的使用

     使用场景:读取自定义配置文件

springBoot注解@PropertySource、@ImportResource、@Bean的使用

springBoot注解@PropertySource、@ImportResource、@Bean的使用

2,@ImportResource的使用(引入spring配置文件,不引入的话,springBoot读取不了spring配置文件 )

springBoot注解@PropertySource、@ImportResource、@Bean的使用

springBoot注解@PropertySource、@ImportResource、@Bean的使用

springBoot注解@PropertySource、@ImportResource、@Bean的使用

3,@Bean的使用(springBoot推荐使用这种方式为ioc容器添加组件的方式,使用全注解形式)

springBoot注解@PropertySource、@ImportResource、@Bean的使用

springBoot注解@PropertySource、@ImportResource、@Bean的使用

 

 

 

 

 

 

相关文章: