PDA

View Full Version : Multiple config files for different environment?


tdu
04-13-2006, 04:31 PM
I have a Interface tier which is class library. The interface tier also uses SpringNet webserviceClientfactory to create client proxy. I have to create multiple config for different enviroment. E.g one for dev, one for Test, one for production since the clientproxyfactory need to know the webservice Url which is different from environment to envrionment. Is there any elegant way to have just one config file? The problem I am trying to avoid is if I added a object definition in one config, i have to add the same method to the other two config. If a developer forget to add to one of config, the application will break when moved to test or prod.

Thanks for any help.

Bruno Baia
04-13-2006, 06:04 PM
Hi,

You can use the PropertyPlaceholderConfigurer to externalize your web services urls :
http://www.springframework.net/doc/reference/html/objects.html#objects-factory-placeholderconfigurer


-Bruno

tdu
04-13-2006, 08:30 PM
Thanks. It worked very well.

Tony