Announcement Announcement Module
Collapse
No announcement yet.
Multiple properties files: external and internal Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple properties files: external and internal

    I have two Java applications which use Spring and are deployed onto Weblogic. One app uses Spring v 2.5.4, the other v 3.1.1.

    For each application, I'd like to be able to utilise two separate property files - one in the server's filesystem and, if that does not exist for any reason, one included in the application's ear file as a set of "default" values.

    Can I use the "contextroperty-placeholder" entry in the application's applicationContext.xml file to do this? Or, having had an investigation on the Net, could I do something like this?

    Code:
    <!-- Default values loaded first -->
    <context:property-placeholder location="classpath:myEarPropertiesFile.properties" />
    <!-- Overridden values loaded next -->
    <context:property-override location="file:myExternalPropertiesFile.properties" />
    Thanks for any thoughts.

  • #2
    You should be able to load external properties and have them override the default properties packaged with your application. I wrote a bit of code that creates a default directory structure off of the home directory for each app. Properties loaded from this external location can be used to override default properties within the app.

    Jeff

    Comment

    Working...
    X