To reduce this, you may use Resource Environment Provider instead of property files to store your properties, and then do a JNDI call to your app server to do get the values. These are possible for Websphere Application Server, Tomcat, etc. You just need to find how to do it in your application server.
The complete tutorial is in this link : http://www.ibm.com/developerworks/websphere/library/techarticles/0611_totapally/0611_totapally.html
What you require :
1. A class that implements ObjectFactory
2. A class that will be used to call get and set values.
1. Create a class library that implements an ObjectFactory. Here's the source code of what I did.
2. Now create a AppConfig class that is called by the factory.
3. Go to your Websphere Application Server and follow the steps as shown below :
4. Create a new provider.
5.Click on your provider.
6. Click on Referenceables and click on New. Add the Factory Class (AppConfigFactory) and the Class (AppConfig) that we've just created.
7. Click on Apply and Ok. Then go to Resource Environment Entries and create a JNDI.
8. Choose on your referenceable the AppConfigFactory that we just created. After adding, click on the Custom Properties.
9. Add the properties you need, and click apply and ok.
10. Add a JSP file on your application such as the code below :
11. Run your application. You should see your properties viewed. Try changing the properties on the custom properties and restart your application. Once run, you will see the latest changes.
Additional note. If a property in Websphere Application Server has a word password on it, it is automaticaly XORed. I guess this is the default mechanism of Websphere Application Server, to provide atleast a minimum security.
ciao...
Hello, i tried this and it works fine. But when i change the custom properties while my app is running then new properties are not passed to the ObjectFactory (I removed the if(config == null)). Any idea why? I would like to hot-change the properties.
ReplyDeleteBest regards, Steffen
Nobody said you could do it on the fly. However, restarting the app is still much faster than re-deploying.
ReplyDeleteThank!!
ReplyDeleteAny idea if this can be achieved in JBoss7 too?
ReplyDeleteThey are the general population to whom you can clarify your ideas, your thoughts and they will give you bona fide input. At some point certain things appears to be anything but difficult to do yet in all actuality it is troublesome so they will control you and fix your things in all actuality if conceivable. convert website to app
ReplyDeleteWhere and who are your potential tenants? Are there businesses and organisations locally with an ever changing workforce, such as hospitals, universities, even TV studios where people are usually employed on short-term contracts?
ReplyDeletezillow ocala fl 34476
Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! Assertiveness Training Melbourne
ReplyDeleteIn other instances you may be lucky enough to buy something for less than it is worth and sell it the next day for market value thereby making a profit on the 'turn' or 'flip'. You will normally have to pay Capital Gains Tax on the increase of the property's value when you sell it.Forestry Mulching
ReplyDeleteI see some amazingly important and kept up to length of your strength searching for in your on the site Roblox APK iOS Download
ReplyDeleteHi buddies, it is great written piece entirely defined, continue the good work constantly. Tubemate APK Here Download Latest & Updated File
ReplyDeleteIf you don"t mind proceed with this extraordinary work and I anticipate a greater amount of your magnificent blog entries Tubidy Video APK Download Latest version Free
ReplyDeleteAs a result of the rule change, buying Singapore property has definitely become significantly easier for those purchasing domestically and abroad. martin modern
ReplyDeleteWe now repeat the same lines and calculations for projecting our equity line of credit balances. Once we are done with these two sources, we have completed our financing worksheet.SubZero, Viking Ice Maker Repair Near Me
ReplyDeleteI have bookmarked your website because this site contains valuable information in it. I am really happy with articles quality and presentation. Thanks a lot for keeping great stuff. I am very much thankful for this site. Costa Del Sol Property For Sale
ReplyDeleteThanks for a very interesting blog. What else may I get that kind of info written in such a perfect approach? I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info. Bellevue Property Management
ReplyDeleteNice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here. Property auctions
ReplyDelete