GWT: @DefaultStringArrayValue is not working after deploying .war file in tomcat

142 views Asked by At

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

1

There are 1 answers

1
David Levesque On BEST ANSWER

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();