How do I access an element from an array in a properties file?
testKey = word1,word2,word3
Something like this is not working (assume properties file is mapped to “msg”
#{msg.testKey[0]} <- to access first element
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s a
String, not aString[]. You’ve got to split it on the comma first byfn:split()to get aString[]out of it so that you can access the items by an index.