spring属性注入总结
1、注入字符串数组1)定义properties配置文件:student.type=a,b,c,dyml配置文件:studenttype: a,b,c,d注:字符串之间都是用英文逗号隔开的2)使用方式1:直接将值赋值给注解中的字符串属性对象:"#{'${student.type}'.split(',')}"方式2:@Value("${student.type}")private List<Integer> studentType;注意:方式...
原创
2021-04-15 15:21:57 ·
262 阅读 ·
0 评论