从属性文件读取列表并加载spring annotation@Value

从属性文件读取列表并加载spring annotation@Value,第1张

从属性文件读取列表并加载spring annotation@Value

使用

Spring EL

@Value("#{'${my.list.of.strings}'.split(',')}") private List<String> myList;

假设使用以下内容正确加载了属性文件:

my.list.of.strings=ABC,CDE,EFG


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/4921431.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-12
下一篇 2022-11-12

发表评论

登录后才能评论

评论列表(0条)

保存