@PropertySource(value={"classpath://aaa.properties"})指定property文件路径,不指定则默认加载application.properties
@ImportResource(locations = {"classpath:beans.xml"}) 是导入spring 的bean 配置,但是spring boot 不建议这样做,spring boot 建议先建一个配置文件,然后用@Configuration标记class ,@Bean 标记方法体,如下图
@ConfigurationProperties 和@Value区别
最新推荐文章于 2023-03-30 18:11:25 发布