Announcement Announcement Module
Collapse
No announcement yet.
Populating java.util.Properties from properties file. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Populating java.util.Properties from properties file.

    I am trying to populate java.util.Properties from properties file, but I do not know how. I am trying to do something like this:

    <bean id="ttt" class="com.foo.bar">
    <property name="properties">
    <props>
    <value>classpath:test.properties</value>
    </props>
    </property>
    </bean>

  • #2
    You can do this:

    Code:
    <bean id="ttt" class="com.foo.bar">
      <property name="properties">
        <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
          <property name="location">
            <value>classpath&#58;test.properties</value>
          </property>
        </bean>
      </property>
    </bean>

    Comment

    Working...
    X