I have following bean declaration:
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>WEB-INF/classes/config/properties/database.properties</value>
<value>classpath:config/properties/database.properties</value>
</list>
</property>
<property name="ignoreResourceNotFound" value="true"/>
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
</bean>
Now I want to change above PropertyPlaceholderConfigurer to following format:
<context:component-scan base-package="org.example.config"/>
<util:properties id="jdbcProperties"
location="classpath:config/properties/database.properties"/>
- ignoreResourceNotFound will ignore the property while running. e.g: When testing application WEB-INF/.. path will ignore( since maven project and property file is under src/main/resources/..), while launching web application, other property will ignore path, I need to implement same with above format.
- should be able to add multiple property file like database.properties, test.properties etc.
- in Spring 3, can I use annotation instead of these xml files for DB loading, how can I do it? since I am using only one xml file(given above) to load db stuff.
I am using Spring 3 framework.