I use this many times in my XML codes:
${some.value}
where some.value may come from
- Properties file
- System.setProperty(“some.value”, “any_value”);
Example:
In case of spring context,
<bean id="placeholderConfig"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:test.properties" />
</bean>
<bean id="anyID" class="com.my.package.MyClass" >
<constructor-arg index="0" value="${some.value}" />
</bean>
And test.properties is,
some.value=any_value
What are they called?
What exactly are them?
System Properties :
It is common property file for your machine which maintained by Java in
java.lang.Systemclass. Here is the detail document for System Properties.when you set
System.setProperty("some.value", "any_value");you can access the value of property anywhere in your java program by callingSystem.getproperty("some.value");Properties file:
A file that is saved in format of
Key & Valuepair with new line separator and.propertiesis the extension of file. Java doc for Properties