Announcement Announcement Module
Collapse
No announcement yet.
Change contextConfigLocation based on a variable in a properties file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change contextConfigLocation based on a variable in a properties file

    Hi,

    How can I change the param-value of contextConfigLocation (as below) based on a variable in a properties file ?

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:/application-context*.xml
    </param-value>
    </context-param>

    For example
    - if a variable running_mode = TEST, load application-context_TEST.xml
    - if a variable running_mode = PROD, load application-context_PROD.xml

    Thanks,
    patch

  • #2
    You cannot... You can use system/environment properties to load specific files.

    However I would advice against it, I suggest using the new profile/environment options in Spring 3.2 to load different beans based on your active profile, instead of creating different xml files for each environment.

    Comment

    Working...
    X