@PropertySource
用于加载指定的配置文件
只能,用于properties文件
使用方式
结合@ConfigurationProperties注解
指定读取配置中的属性
@PropertySource(value = {"classpath:person.properties"})
@Component
@ConfigurationProperties(prefix = "person")
public class Person {
用于加载指定的配置文件
只能,用于properties文件
使用方式
结合@ConfigurationProperties注解
指定读取配置中的属性
@PropertySource(value = {"classpath:person.properties"})
@Component
@ConfigurationProperties(prefix = "person")
public class Person {