Announcement Announcement Module
Collapse
No announcement yet.
Daft question. Reloading properties file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Daft question. Reloading properties file

    Hi

    I imagine this is a daft question and I'm missing something obvious, but...

    I have 2 peoperties files. the usual applicationContext.xml which will be shipped within a war file, and I have an external properties file which I want to exist external to the war file, so that properties may be manipulated without needing to expand and recreate the war file.

    I am loadin gthe applicationContext in the usual way through the web.xml.

    Once that is created I want to then check the 2nd properties file,and load these new properties into the same context, overwriting vlaues if there is a conflict.

    How can I do this.

    I have tried calling loadBeanDefinition() (this is protected so I had to create a class that inherits from XmlWebApplicationContext so I could access it) but it doesn't seem to work.

    Any suggestions?

    Cheers,

  • #2
    Originally posted by khylo View Post
    Hi

    I imagine this is a daft question and I'm missing something obvious, but...

    I have 2 peoperties files. the usual applicationContext.xml which will be shipped within a war file, and I have an external properties file which I want to exist external to the war file, so that properties may be manipulated without needing to expand and recreate the war file.

    I am loadin gthe applicationContext in the usual way through the web.xml.

    Once that is created I want to then check the 2nd properties file,and load these new properties into the same context, overwriting vlaues if there is a conflict.

    How can I do this.

    I have tried calling loadBeanDefinition() (this is protected so I had to create a class that inherits from XmlWebApplicationContext so I could access it) but it doesn't seem to work.

    Any suggestions?

    Cheers,
    I would check out PropertyOverrideConfigurer and PropertyPlaceholderConfigurer. I have used these for handling local properties (inside my war) and for system properties (outside my war).

    Comment

    Working...
    X