
正文
spring 属性文件加载接口---PropertySourceLoader
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
org.springframework.boot.config
Interface PropertySourceLoader
- PropertiesPropertySourceLoader, YamlPropertySourceLoader
PropertiesPropertySourceLoader:加载 .properties 文件
YamlPropertySourceLoader:加载 .yaml 文件
使用
@PropertySource({"classpath:config.properties"})
注解,或者
实现类: public interface PropertySourceLoader
属性文件加载策略接口
<context:property-placeholder location="classpath:application.yml"/>








