Reading property file in java using Spring -
- have been trying understand how load property file using spring in java , populate
java.util.properties
object. - use newly created property object constructor arguement bean.
appreciate pointers on this.
thanks, cabear
to load properties file in spring use propertiesfactorybean
make easier use there properties
tag in util
namespace can use.
<util:properties id="props" location="location-of.properties" />
then have bean named props
can use regular bean.
<bean id="otherbean" class="my.app.myclass" > <constructor-arg ref="props" /> </bean>
when using property placeholder support use same properties object again instead of loading again, referencing using properties-ref
attribute of property-placeholder
tag.
<context:property-placeholder properties-ref="props" />
Comments
Post a Comment