I'm able to use Jakarta Commons Configuration with .properties files and
String[] properties, but when I use variable interpolation to refer to a
String[] property, it only returns the first element. Example:
.properties file contents:
test.email.addresses = [EMAIL PROTECTED],
[EMAIL PROTECTED]
test.email.recipients = ${test.email.addresses}
Code:
String[] testEmailAddresses = config.getStringArray("test.email.addresses");
String[] testEmailRecipients =
config.getStringArray("test.email.recipients");
System.out.println("testEmailAddresses = " +
ArrayUtils.toString(testEmailAddresses));
System.out.println("testEmailRecipients = " +
ArrayUtils.toString(testEmailRecipients));
Output:
testEmailAddresses =
[EMAIL PROTECTED],[EMAIL PROTECTED]
testEmailRecipients = [EMAIL PROTECTED]
Shouldn't testEmailRecipients get the same String[] value as
testEmailAddresses? Am I doing something wrong, or can't this be done?
Is there a special recursive variable interpolation character for arrays?
- Jim
______________________________
James Watkin
ACIS Software Development
UCLA Anderson School
[EMAIL PROTECTED]
Voice: 1-310-825-5030
Fax: 1-310-825-4835
______________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]