문제

I'am using Configuration 1.6.

I hava a xml file, like

<property>
    <name>sql</name>
    <value><![CDATA[select a, b from c]]></value>
</property>

I wish to get "select a, b from c" as a whole string, but i get "select a" and "b from c" as List instead.

You may suggest I join the string's with commas, but somewhere else in my project depends on this property.

도움이 되었습니까?

해결책

Change the property of PropertiesConfiguration object like this:

AbstractConfiguration.setListDelimiter(0);

Setting the delimiter to 0 will disable value splitting completely.

That should work.

다른 팁

Using commons configuration 1.9 it is recommend to use:

    config = new XMLConfiguration();
    config.setListDelimiter((char) 0);
    config.setDelimiterParsingDisabled(true);
    config.setAttributeSplittingDisabled(true);
    config.load(resource);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top