@Value注解从配置文件中读取数组
作用:从配置文件中取值
用法:
1.取单个值
(1)configuration.properties配置
status.notice.switch=open
(2)java文件自动注入
@Value("${status.notice.switch}")
private String statusNoticeSwitch;
2.取数组
(1)configuration.properties配置
lanwon.hospital.id=43534,234543,w3
原创
2020-06-18 19:01:50 ·
15824 阅读 ·
4 评论