Quantcast
Channel: Nucleus – betweenGo
Viewing all articles
Browse latest Browse all 6

ATG does not allow property values with commas for String[] properties

$
0
0

Typically when you have a property of Strings, either an array or a collection, you would set them like this:

foos=hello,good-bye,this is a test

In the above example if the foos property is of type String [], then ATG initializes foos to { “hello”, “good-bye”, “this is a test” }.

However if one of the String’s has a comma in it then this method won’t work because ATG will treat the comma as a delimiter. For example if foos is configured like this:

foos=hello,good-bye,this is a test\, a big test

then foos is initialized to { “hello”, “good-bye”, “this is a test”, “a big test” }

To get around this apparent limitation, which is documented in Bug #29380, ATG provides a class called atg.core.util.StringList. If you set the type of the foos property to StringList and configure it like this:

foos=hello,good-bye,this is a test,, a big test

then fools will be initialized to { “hello”, “good-bye”, “this is a test, a big test” }. Note that “,,” is the method for escaping commas when using StringList.


Viewing all articles
Browse latest Browse all 6

Trending Articles