org.springframework.boot.config
Interface PropertySourceLoader
-
public interface PropertySourceLoader
屬性文件加載策略接口
-
PropertiesPropertySourceLoader:加載 .properties 文件
-
YamlPropertySourceLoader:加載 .yaml 文件
-
使用
@PropertySource({"classpath:config.properties"})
注解,或者
<context:property-placeholder location="classpath:application.yml"/>