开发者

Spring's PropertyPlaceholderConfigurer with property in a jar file

开发者 https://www.devze.com 2022-12-09 15:13 出处:网络
I have multiple prope开发者_JAVA百科rty files I need to refer to. Below I can refer to two that are on the classpath.

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

精彩评论

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