commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Watkin <james.wat...@anderson.ucla.edu>
Subject Jakarta Commons Configuration - Problem with Variable Interpolation and StringArray
Date Tue, 09 Oct 2007 22:03:40 GMT
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 = firstName1.LastName1@mydomain.edu, 
firstName2.LastName2@mydomain.edu

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 = 
{firstName1.LastName1@mydomain.edu,firstName2.LastName2@mydomain.edu}
testEmailRecipients = {firstName1.LastName1@mydomain.edu}

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
james.watkin@anderson.ucla.edu
Voice: 1-310-825-5030
   Fax: 1-310-825-4835
______________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message