• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

InitParameters

 
Amul Kanjer
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to change the InitParameters of a servlet on the fly without reloading the servlet.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two easy ways to do it, firstly you can mek them instance variable so they are shared by all threads then anyone can alter the details, but this becomes difficult to track and manage.
The way we sometimes do it is have all properties (initparams or other) managed in an external class for all situations. This can, for example, represent a dynamic properties class that checks for changes in the properties file and reloads them if required.
Dave.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic