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
The following rules apply to the definition of variables in a properties file: Valid characters in a variable name are uppercase and lowercase letters, numbers 0 - 9, periods, underscores, and hyphens. Variable names are limited to 255 characters. Properties files can exist in a CICS® bundle or an application binding.
You might want look at Apache Configuration,
http://commons.apache.org/configuration/
Among many features it supports is the Variable Interpolation.
What you want to do is impossible using the Java Properties
class.
Property keys and values are simply Strings. No processing happens to them, so you can't refer to another value in a value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With