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 Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dynamically  load  properties file" Watch "Dynamically  load  properties file" New topic
Author

Dynamically load properties file

prithivirajan dhamodharan
Greenhorn

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
Greenhorn

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.


Merrill
Consultant, Sima Solutions
 
 
subject: Dynamically load properties file