-
Configuring Properties Files(And Autoload) in Java Applications (4 messages)
- Posted by: Parminder Singh
- Posted on: January 26 2010 10:05 EST
Here's (http://bit.ly/8qX4X8) an article showing a simple and elegant way of reading and configuring properties/configuration files in Java applications using annotations. Properties files are one of the most frequently used mechanism for storing configuration information for applications. And so is the code to access these properties from the application. This article is intended to demonstrate (source code can be downloaded here) a simple way of configuring and using Properties files in Java applications. Usage Example: 1. Cofiguring: @PropertiesHolder(file="app.properties", autoLoad=true) private static Properties appProps; 2. Reading: String title = PropStore.getAppProps().getProperty("APP_TITLE"); The full article can be read here: http://bit.ly/8qX4X8 Please post your comments and feedback.Threaded Messages (4)
- Commons Configuration by Antonio Petrelli on January 27 2010 04:07 EST
- Re: Commons Configuration by Parminder Singh on January 28 2010 10:35 EST
- Re: Commons Configuration by Antonio Petrelli on January 29 2010 04:04 EST
- Re: Commons Configuration by Parminder Singh on January 28 2010 10:35 EST
- Re: Configuring Properties Files(And Autoload)... by Richard Jome on February 04 2010 06:57 EST
-
Commons Configuration[ Go to top ]
- Posted by: Antonio Petrelli
- Posted on: January 27 2010 04:07 EST
- in response to Parminder Singh
Apache Commons Configuration offers automatic reloading OOTB, and it allows to load configurations from a variety of sources (properties, XML, etc.) -
Re: Commons Configuration[ Go to top ]
- Posted by: Parminder Singh
- Posted on: January 28 2010 10:35 EST
- in response to Antonio Petrelli
If you read the full article, it says, this is meant for apps where such frameworks/facilities are not available. -
Re: Commons Configuration[ Go to top ]
- Posted by: Antonio Petrelli
- Posted on: January 29 2010 04:04 EST
- in response to Parminder Singh
If you read the full article, it says, this is meant for apps where such frameworks/facilities are not available.
Are you sure? At the end of the article it says:Please note, that most of the modern web based frameworks do have some sort of Properties/configuration framework built in. This article is intended for applications that do not have such frameworks/facilities available
I am sorry but Commons Configuration is *not* a web based framework. -
Re: Configuring Properties Files(And Autoload)...[ Go to top ]
- Posted by: Richard Jome
- Posted on: February 04 2010 06:57 EST
- in response to Parminder Singh
ere's an article showing a simple and elegant way of reading and configuring properties/configuration files in Java applications using annotations. The article also contains source code with each step explained. ยป Full text http://redtram.com/redirect/news/237298888/ Thanks =========== personalized baby name gifts unique baby gifts Baby Name Gift