Wednesday, July 10, 2013

How to resolve system variables in spring xml configuration

during Tomcat launch you can specify system variable as ".... -Dmy.value=Hello .... "

but do not forget to put in you Spring configuration following bean:
<bean id="system-properties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />

to make this variable resolvable in any other bean configuration like:

<entry key="myValue" value="${my.value}" />

No comments:

Post a Comment