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

  • Deployment configuration options

    Hi all,

    We have an app which will be deployed at a number of sites. We call some external programs, so there are some configuration differences such as the location of the external binaries and their working directories. A recent requirements change mandates that users be able to configure these settings through our admin webapp.

    Originally I used PropertyPlaceholderConfigurer to pull the values from a properties file and inject them as bean properties. In order to support editing the configuration through the web, I moved to a ConfigDao interface backed by a JDBC implementation. Now, however, I have a lot of confgDao.getProperty("foo") calls in the code, which aren't really sitting right with me.

    How have other people dealt with this situation?


  • #2
    I had a similar problem and solved it by writting my own version of PropertyPlaceholderConfigurer. You can check it out at For ideas on how to implement your own evaluator have a look at the CommonsPlaceholderEvaluator class.

    It currently supports spring 1.1.5 and works well (I use the code in production applications). I'm planning on fixing the spring 1.2 issues some time soon...


    • #3
      I have taken a look at spring-config and it looks to be near to what I need. It seems easiest to subclass PropertyPlaceholderConfigurer as you did and resolve properties using my ConfigDao. The only downside to this approach is that the ApplicationContext will have to be refreshed after the properties have been saved.