Results 1 to 4 of 4

Thread: Setting the location of a properties file via PropertyPlaceholderConfigurer

  1. #1
    Join Date
    Oct 2006
    Posts
    7

    Default 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. #2
    Join Date
    Apr 2006
    Location
    Canada
    Posts
    164

    Default

    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
    Chris Lee (blog)
    Principal Consultant
    Digital Ascent Inc.

  3. #3
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

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

    For your reference.
    http://www.springframework.org/docs/...lderconfigurer
    http://static.springframework.org/sp...onfigurer.html
    Last edited by karldmoore; Jan 15th, 2007 at 04:40 PM. Reason: typo

  4. #4
    Join Date
    Oct 2006
    Posts
    7

    Default

    Thanks for the help Chris worked like a charm.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •