Announcement Announcement Module
No announcement yet.
Setting the location of a properties file via PropertyPlaceholderConfigurer Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Setting the location of a properties file via PropertyPlaceholderConfigurer

    I am running inside of JBoss and my application is contained within a war file. I would like to have a properties file outside of the war file that the user can modify.

    My company generally keeps all external files and what not under the jboss.server.home.dir /Data/Properties directory. The problem I have is setting the location of the properties file via the applicationContext.xml since I need to access the jboss.server.home.dir in order to find out the fully qualified path.

    Do I need to create the PropertyPlaceholderConfigurer inside my code and then set the location and have it run the postProcessBeanFactory?

    Is there a way to do this?

    Thanks in advance for any help I receive.

  • #2
    You can instantiate a PropertyPlaceHolderConfigurer in your application context, configure it to look at system properties, and then use ${jboss.server.dir} which JBoss exposes as a system property


    • #3
      I would say Chris is spot on! We are actually doing something very similar at the moment, it works great.

      For your reference.
      Last edited by karldmoore; Jan 15th, 2007, 04:40 PM. Reason: typo


      • #4
        Thanks for the help Chris worked like a charm.