-
Feb 1st, 2006, 02:38 PM
#1
How-to have different applicationContext.xml files
Can someone tell me if there is a clean way to be able to load different applicationContext.xml files depending on the hostname?
I am running on a local, development, test, and production environment, but I only want to deploy one war file....
Can I subclass the spring servlet and have it choose the applicationContext there... or something similar?
Thanks in Advance!!!
-
Feb 1st, 2006, 03:20 PM
#2
Check out PropertyPlaceHolderConfigurer.
The idea is to have different property files for each environment.
In the 'locations' property, you can use the classpath: notation to specify which property files to use. This is all in the manual, check it out.
-
Feb 1st, 2006, 04:01 PM
#3
Thanks for the info. That looks like exactly what I need...
Still, I need to know how I would be able to load this on startup. The servlet and contextloaderlistener are loaded by my web.xml. I can do the grunt work obviously, but would I be correct in saying that i would probably need to subclass the contextloaderlistener?
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