-
Jan 15th, 2007, 03:51 PM
#1
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.
-
Jan 15th, 2007, 04:13 PM
#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
-
Jan 15th, 2007, 04:34 PM
#3
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
-
Jan 16th, 2007, 09:08 AM
#4
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
-
Forum Rules