commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <oliver.he...@oliver-heger.de>
Subject Re: [configuration] Interpolation over several files, commons config 1.4
Date Tue, 21 Aug 2007 09:56:32 GMT
David J. M. Karlsen wrote:
> Hi!
> 
> I'm can use interpolation within a property file with success.
> But I'd like to be able to spread this over several files.
> 
> F.ex:
> 
> prop1.properties:
> var1=somevalue1
> var2=somevalue2
> 
> 
> prop2.properties
> myvar1=${var1}
> myvar2=${var2}
> 
> so that the resulting java.util.Properties would contain these values:
> var1=somevalue1
> var2=somevalue2
> myvar1=somevalue1
> myvar2=somevalue2
> 
> 
> I can't get this to work - even with a CompoundConfiguration.
> 
> Any pointers?
> 
> TIA,
> David
> 
It would be helpful if you could provide some code fragments
demonstrating what you are doing and how you are creating a
java.util.Properties object. So I am not sure what is going wrong.

Interpolation in CombinedConfiguration should work over multiple
configuration sources. But because I don't know your actual use case I
can't say whether this helps you.

Did you have a look at the include directives for
PropertiesConfiguration [1]? Maybe this is an option?

Oliver

[1]
http://commons.apache.org/configuration/userguide/howto_properties.html#Includes

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message