开发者

Spring's PropertyPlaceholderConfigurer with property in a jar file

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜