wood burning stoves 2.0
The moose likes Struts and the fly likes Dynamically  load  properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dynamically  load  properties file" Watch "Dynamically  load  properties file" New topic

Dynamically load properties file

prithivirajan dhamodharan

Joined: Feb 19, 2007
Posts: 6
How the load the Application Resource properties without reloading/restart the application.

ie, it should detect the change of values happened in properties file and the new value should get loaded
RoshaniG Gopal
Ranch Hand

Joined: May 15, 2006
Posts: 180
Hi Prithivirajan,

As far i know it is not possible. You need to restart the server for the same because it is loaded on server start up and to change it would also req a server restart.

Regards,<br />Roshani
prithivirajan dhamodharan

Joined: Feb 19, 2007
Posts: 6
How about configuring a separate servlet,

which can retrieve the ActionServlet stored in ServletContent and invoke the initModuleMessageResources(moduleConfig) method to load property file again.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
A number of people of asked this question in this forum, and we've told each of them the same thing we've told you: Struts doesn't support it. Some of them have tried various means of doing it anyway, but to my knowledge no one has reported any success.

If you have a good idea for how to do it, by all means try it. If you are successful, please share your method with us.

Consultant, Sima Solutions
I agree. Here's the link: http://aspose.com/file-tools
subject: Dynamically load properties file
It's not a secret anymore!