I have multiple prope开发者_JAVA百科rty files I need to refer to. Below I can refer to two that are on the classpath.
How do I refer to a property file with in a jar file ?
<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>
If the JAR is in the classpath, then you can reference the properties file inside just like any other resource. Just specify the location of the properties file within the JAR file.
精彩评论