File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes InitParameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "InitParameters" Watch "InitParameters" New topic


Amul Kanjer

Joined: Sep 27, 2001
Posts: 1
Is there a way to change the InitParameters of a servlet on the fly without reloading the servlet.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

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.
I agree. Here's the link:
subject: InitParameters
It's not a secret anymore!