May 16th, 2012, 03:52 PM
External properties configuration.
I am working on a project and I need to be able to store some properties in an external .properties file so that they can be different per environment. It looks like I can do this a few different ways. One route seems to be using a PropertyPlaceholderConfigurer and subclassing it to override the convert method. This concerns me as the PropertyPlaceholderConfigurer is already being used for some other property files. Could I create a separate bean using my subclassed version and use that to get my properties files in?
My other thought is to start using the Apache Commons Configuration. It looks like that will do the conversion for me.
Would it matter which route I go? Is one better practice than the other? Or is it entirely dependent on my application?
Any advice, comments, thoughts, ect are greatly appreciated.
May 17th, 2012, 04:22 AM
I won't be able to help you with PropertyPlaceholderConfigurer idea, but I had the same kind of problem (storing properties, but in the way they can be different per user or environment) and what I found as a best option then was Java Preferences API (part of standard Java SE). You can take a look here for a quick overview:
I hope it will be helpful for you.
May 17th, 2012, 07:13 AM
The following link can be useful in order to configure multiple PropertyPlaceholderConfigurer.
I hope this will be helpful.
Tags for this Thread