Is there a possibility to configure the Spring PropertyPlaceholderConfigurer to read from properties.xml, via Apache Commons Configuration?
The easiest way (maybe not the nicest though) would be to subclass the PropertyPlaceholdeConfigurer, load the commons configuration there and then pass it to the superclass:
public class TestPlaceholderConfigurer extends PropertyPlaceholderConfigurer
{
public TestPlaceholderConfigurer()
{
super();
}
@Override
protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props)
throws BeansException
{
XMLConfiguration config = new XMLConfiguration("config.xml");
Properties commonsProperties = config.getProperties("someKey")
// Or something else with the configuration
super.processProperties(beanFactoryToProcess, commonsProperties);
}
}
Then you just use this class as the placeholderConfig: