Let's say you have a Spring managed bean that contains some properties that you would like to externalize from your application, say perhaps in a JBoss 'conf' folder properties file. Apparently you can do this via annotations in Spring 3, but it's also fairly straightforward in Spring 2.5:
From the context.xml file:
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:my_app.properties"/>
<property name="placeholderPrefix" value="$prop{"/>
</bean>
<bean id="someBeanWithProps" class="my.class.with.Props">
<property name="myPropA" value="$prop{prop.file.entry.prop.A}"/>
<property name="myPropB" value="$prop{prop.file.entry.prop.B}"/>
</bean>
Spring Integration and XSLT with parameters
6 years ago
No comments:
Post a Comment