Question

I have defined an Array of string constants in resources.i18n package. Inside TestConstants.java

@DefaultStringArrayValue("Win,Win32,Win64,Sun,Linux,iOS,iPhone,Mac")
String[] platforms();

Also make an entry in TestConstants.properties as below

platforms = Win,Win32,Win64,Sun,Linux,iOS,iPhone,Mac

This code is working fine after Launching Application from eclipse. "platforms" returns Array of String as mentioned above.

After deploying .war on Apache Tomcat."platforms" return single String instead of Array of String. It returns "Win,Win32,Win64,Sun,Linux,iOS,iPhone,Mac" as one String.

I have created .war file using Maven "mvn clean install". Thanks

Was it helpful?

Solution

Try putting double quotes around each string and curly braces around the whole array, e.g.:

@DefaultStringArrayValue({"Win","Win32","Win64","Sun","Linux","iOS","iPhone","Mac"})
String[] platforms();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top