Spring中,一般使用classpath:来配置PropertyPlaceholderConfigurer的location属性,今天想通过文件路径的方式进行配置,尝试了多次,发现似乎是只支持绝对路径方式,格式是:file:文件路径。配置如下:
不知道谁还有没有更好的办法可以支持file:的相对路径。
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="file:d:/xxx/websrc/WEB-INF/db.properties" />
</bean>
不知道谁还有没有更好的办法可以支持file:的相对路径。