Can I reference another property in a properties file (use ${property})

Martin Magakian picture Martin Magakian · Sep 11, 2009 · Viewed 56.2k times · Source

Possible Duplicate:
How to reference another property in java.util.Properties?

look at my "file.properties":

key1= My name is
key2= ${key1} Martin !

Why when I get the value of "key2" my result is "${key1} Martin !" unlike "My name is Martin !"

=> I program in Java 6
=> I use java.util.Properties

Answer

ZZ Coder picture ZZ Coder · Sep 11, 2009

You might want look at Apache Configuration,

http://commons.apache.org/configuration/

Among many features it supports is the Variable Interpolation.