I was wondering if there is any way to have a place holder in configuration or mapping file which would be replace with the system property at runtime.
E.g:
If there is a line below in configuration or property file
<property name="database.password" value="${database.password}"/>
then ${database.password} should be replace with the system property.
(This approach is used by spring and we use to keep all the environment related stuff in system property so that we do not have to change the configuration file for different environments.)
If above factility is not available what would be the best approach to accomplish it. I was thinking of reading the xml file, manipulating it myself to replace the system property, create the dom and supply it to Configuation.configure(dom).
We also have lot of mapping files with following.
<component name="auditInfo" class="AuditInfo">
<property name="userAddId" type="string" column="USER_ADD_ID"/>
<property name="processAddId" type="string" column="PROCESS_ADD_ID"/>
<property name="userUpdateId" type="string" column="USER_UPDATE_ID"/>
<property name="userAddId" type="string" column="PROCESS_UPDATE_ID"/>
<property name="addDate" type="timestamp" column="STAMP_ADD_DTM"/>
<property name="updateDate" type="timestamp" column="STAMP_UPDATE_DTM"/>
</component>
Is there any way to avoid putting it in each file.
|