DECAFFMEYER MATHIEU wrote:
Hi,

I am using this snippet of code to get dynamically the configuration settings of my app. :

URL url =
        Thread.currentThread().getContextClassLoader().getResource(
                "ress/config.xml");
ConfigurationFactory factory =* **new* ConfigurationFactory();
factory.setConfigurationURL(url);
Configuration conf =* null*;
*try* {
        conf = factory.getConfiguration();
}* catch* (ConfigurationException e) {
        e.printStackTrace();
}


The problem here is that I am trying to get an XMLConfiguration and not a Configuraton object, to do operations on the configuration file itself (change the settings), which is an XML file.

any tips on how to get an XMLConfiguration from a the ConfigurationFactory ?

Thank u !

*__________________________________*

*   Matt*////

You can cast the Configuration object you obtain from the factory to a CompositeConfiguration. This class provides the getConfiguration(int index) method, which gives you access to the child configurations. The XMLConfiguration you have loaded using the factory will be one of those.

HTH
Oliver


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to