2009-10-21 68 views
4

我有需要引用的多个属性文件。下面我可以参考两个类路径。Spring的PropertyPlaceholderConfigurer与一个jar文件中的属性

如何在一个jar文件中引用属性文件?

<bean id="placeholderConfig" name="placeholderConfig" 
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> 
<property name="locations"> 
    <list> 
    <value>classpath:config/my_test.properties</value> 
    <value>classpath:config/some_other.properties</value> 
    </list> 
</property> 

回答

5

如果JAR在classpath中,那么你可以参考的属性文件中,就像任何其他资源。只需在JAR文件中指定属性文件的位置即可。

+2

太简单了 - thx – 2009-10-21 10:07:32

相关问题