9.2 Using XProperties

The XProperties system (Introduction in XProperties Tutorial) offers enhancements to the standard Java properties as:

If you want to use to XProperties in applicationContext.xml, you can simply activate a Spring property placeholder configurer:

        <bean class="org.openxma.dsl.platform.config.XPropertiesPlaceholderConfigurer" />
        

Then, you can refer to XProperty entries with Expression Language syntax. The following sets the property myProperty of the instance of MyTestingBean to the value of the at.spardat.sample.hello property.

        <bean class="org.openxma.demo.customer.MyTestingBean" p:myProperty="${at.spardat.sample.hello}" />
        

This mechanism can be used e.g. to externalize DB passwords from applicationContext.xml file.