Announcement Announcement Module
No announcement yet.
External properties configuration. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • External properties configuration.

    Hello all,

    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.

  • #2

    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.


    • #3
      The following link can be useful in order to configure multiple PropertyPlaceholderConfigurer.

      I hope this will be helpful.