100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > @Value注解从配置文件中读取数组

@Value注解从配置文件中读取数组

时间:2024-05-21 01:39:55

相关推荐

@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,w353654(2)java文件自动注入@Value("#{'${lanwon.hospital.id}'.split(',')}")private List<String> hospitalIdList;

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。