1 // ${key} 从环境变量、配置文件中取值 2 @Value("${person.last-name}") 3 private String lastName; 4 // #{Spel} Spring支持的表达式 5 @Value("#{11*2}") 6 private Integer age; 7 // 字面量 8 @Value("true") 9 private Boolean boss;
六、SpringBoot配置@ConfigurationProperties与@Value区别
原文:https://www.cnblogs.com/jtfr/p/10500487.html