我正在加载属性文件
@PropertySource("classpath:propFile.properties")
在此属性文件中,我有以下条目:
list.of.stg=a,b,c
此外,我这样做:
@Value("${list.of.stg}")public void setSomeList(...)<br/>{in the method, the parameter has only the value a!!!}
您能否告诉我一种达到完整值的方法
list.of.stg
谢谢!
最佳答案
尝试使用
@Value("#{T(org.springframework.util.StringUtils).commaDelimitedListToStringArray(environment['list.of.stg'])}")
关于java - Spring,有分隔符时的属性值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15415826/