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

StackOverflow https://stackoverflow.com/questions/18526108

  •  26-06-2022
  •  | 
  •  

سؤال

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

هل كانت مفيدة؟

المحلول

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();
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top