views:

481

answers:

1

I have multiple property 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>

+3  A: 

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.

skaffman
so simple - thx
Bill Comer