【发布时间】:2012-03-15 12:15:42
【问题描述】:
如何访问属性文件中数组中的元素?
testKey = word1,word2,word3
这样的事情不起作用(假设属性文件映射到“msg”
#{msg.testKey[0]} <- to access first element
【问题讨论】:
标签: arrays jsf el properties-file
如何访问属性文件中数组中的元素?
testKey = word1,word2,word3
这样的事情不起作用(假设属性文件映射到“msg”
#{msg.testKey[0]} <- to access first element
【问题讨论】:
标签: arrays jsf el properties-file
这是String,而不是String[]。您必须先用逗号将其拆分为fn:split(),以便从中获取String[],以便您可以通过索引访问这些项目。
#{fn:split(msg.testKey, ',')[0]}
【讨论】: