Frage

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.

War es hilfreich?

Lösung

Change the property of PropertiesConfiguration object like this:

AbstractConfiguration.setListDelimiter(0);

Setting the delimiter to 0 will disable value splitting completely.

That should work.

Andere Tipps

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);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top