Aug 27th, 2008, 10:53 AM
Choose different configuration files during startup
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?
Aug 27th, 2008, 11:09 AM
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
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