File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamically load properties file

 
prithivirajan dhamodharan
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 180
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
prithivirajan dhamodharan
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic