-
Aug 27th, 2008, 10:53 AM
#1
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
-
Aug 27th, 2008, 11:09 AM
#2
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.
-
Aug 28th, 2008, 08:02 PM
#3
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
-
Forum Rules