Announcement Announcement Module
Collapse
No announcement yet.
setup commons-configuration as spring context bean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • setup commons-configuration as spring context bean

    Hello,

    I'm trying to configure in my Spring context a commons-configuration "CompositeConfiguration".

    I can setup a simple Configuration instance using :
    Code:
    <bean id="aSimpleConfig" class="org.apache.commons.configuration.PropertiesConfiguration"
    		init-method="load">
    		<property name="URL">		
    			<value>classpath&#58;/org/springframework/context/support/messages.properties</value>
    		</property>
    	</bean>
    I'd like to setup a CompositeConfiguration (that merges multiple Configuration instances) but it requires to call "addConfiguration(config)" for every configuration instance to set in the composite. I don't know how to do this using IoC syntax (perhaps it's out of scope).

    Has someone used compositeConfiguration with Spring ? Should I ask commons-configuration developers to add a "setConfigList(List)" to the compositeConfiguration class to be useable in a IoC context ?

    Nico.

  • #2
    A couple of workarounds were given at the end of this discussion: http://forum.springframework.org/showthread.php?t=13060
    Last edited by robyn; May 16th, 2006, 04:17 AM.

    Comment


    • #3
      I've submited issue http://opensource.atlassian.com/proj...rowse/SPR-1018 about this, using "iterative" injection suggested in the thread you pointed me to.

      Comment

      Working...
      X