-
Oct 27th, 2005, 03:05 PM
#1
setting props for a properties file
Hi,
I was wondering if it is possible to set a variable list of properties on a bean, this list would come from an external properties file.
What I was hoping to find was something like:
<bean id="someBean" class="...">
<property name="manyProps">
<props file="external.properties"/>
</property>
</bean>
Also, it would be nice if you could specify that the external properties file is at a relative location or on the class path.
This not being possible, are there any other solutions to this problem?
Thanks,
Marius
-
Oct 27th, 2005, 03:28 PM
#2
Use a org.springframework.beans.factory.config.Propertie sFactoryBean. You set the location property with the name of the file.
-
Oct 27th, 2005, 05:37 PM
#3
That worked, thanks!
<bean id="someBean" class="...">
<property name="manyProps">
<bean class="org.springframework.beans.factory.config.Pr opertiesFactoryBean">
<property name="location"><value>classpath:external.properti es</value></property>
</bean>
</property>
</bean>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules