문제

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