Announcement Announcement Module
Collapse
No announcement yet.
Reloaded .properties file with updated changes Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reloaded .properties file with updated changes

    Hi,

    I have a question , I am looking to reload a file properties in Spring context without reloading all Context.

    For example, this is an extract of my SpringContext.xml :

    Code:
    <bean name="propertyPlaceholder" class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
    <property name="locations">
    <value>classpath:myFile.properties</value>
    </property>
    </bean>


    <bean id="myBean" class="com.my.company.MyService">

    <property name="myProperty" value="${my.property.value}"/>


    </bean>

    I would like to change the value of my key "my.property.value" in the properties file myFile.properties which is located in classpath, the new value must be reloaded in the Container, now it's seems to be not the way. How to reload the properties and get the updated values populated in the spring MyService class?

    Thanks.

    thanks

  • #2
    Please use [ code][/code ] tags when posting code.

    The only way to get the new values is by reloading the context. The ApplicationContext is constructed at startup and remains static after that.

    Comment


    • #3
      Thanks Marten, Any links or examples are really appreciated. Thanks for the support.

      Comment

      Working...
      X