PDA

View Full Version : using propertyConfigurer



suddal72
Aug 3rd, 2005, 05:24 AM
hi
now i used propertyConfigurer like this
====================================
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyP laceholderConfigurer">
<property name="locations">
<list>
<value>classpath:/app.properties</value>
</list>
</property>
</bean>
====================================
app.propertis

aaa=aaaaaa
bbb=bbbbbb

and i want to use propertyconfigurer in svr class

how can i wire and use properties values..

i want to use the value like this
ex)
String value = propertyConfigurer.getValue("aaa");

is it possible ??

Rick Douglas Evans
Aug 3rd, 2005, 05:57 AM
Hiya

I think you want to use this class (http://www.springframework.org/docs/api/org/springframework/beans/factory/config/PropertiesFactoryBean.html) instead. You can then inject an instance of the Properties (http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html) class directly.

Ciao
Rick