SpringBoot_配置-@PropertySource、@ImportResource、@Bean

  注意:这个@propetySouce必须和@ConfigurationProperties一起使用,只不过@propetySouce会覆盖和@ConfigurationProperties相同的属性值

 

   如果直接写spring的配置文件,sprinboot是无法识别的,必须使用@ImportResouce来加载;一般是在配置类上加@ImportResouce,但是这种方式springboot并不提倡

 

 

   @Bean的作用是将方法的返回值作为组件加入容器中

 

原文地址:https://www.cnblogs.com/ibcdwx/p/13616454.html