Results 1 to 3 of 3

Thread: Choose different configuration files during startup

  1. #1
    Join Date
    Aug 2008
    Posts
    2

    Default Choose different configuration files during startup

    Hi Folks,

    I have to find a way do load different property files (applicationContext.xml, etc) depending on a runtime property from the server.

    During application initialization I'll get a JVM property and then I'd choose which file should I load.

    The problem is, I have no idea which class should I implement (extend) and how would I declare it?

    Any clues?

    Regards,

    Somensari

  2. #2
    Join Date
    Aug 2008
    Posts
    12

    Default

    I don't thing it is currently possible in a simple way.
    I guess I have to determine different configuration at runtime.
    Maybe JavaConfig project could help. With that features you can refonfigure the container via java code, so runtime.

  3. #3
    Join Date
    Aug 2008
    Posts
    2

    Default

    I found the solution, and it's quite simple

    There's a method in the DispatcherServlet called setConfigLocation(String) where you can point the path you want during the initialization. I've subclassed the method, implemented init() and setted the new path.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •