spring的propertyPlaceholderConfigurer怎么获取到相对路径

最近有个需求:在Tomcat的webapps中建立个文件夹config,里面都是存放着properties配置文件比如db,log4j等。现在是要求war包和配置文件分离,部署war包后去读取同一级目录下的config文件夹的配置文件。统一用相对路径去读取配置文件。问题来了我在web.xml里加入如下代码

    <context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>../config/log.properties</param-value>
    </context-param>

log4j可以通过相对路径读取到log4的properties文件。
但是DB不行了。在spring.xml下就不行了如下:

    <bean id="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" >
        <property name="locations">
            <list>

                <value>../config/db.properties</value>
            </list>
        </property>
         <property name="fileEncoding" value="UTF-8"/>
    </bean>

这样子根本读取不到。试了很多方式。只能用绝对路径可以获取到,但是相对路径不行啊。求解。war包和config文件在同一级目录

把config放到classpath上然后

<bean id="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" >
  <property name="location" value="classpath:config/db.properties" />
  <property name="fileEncoding" value="UTF-8"/>
</bean>