This may not work, but is worth a try...
Create a servlet which does nothing other then read the init parameters into
static variables and provides static functions to access the variables
containing the init parameters. Then in web.xml tell this servlet
<load-on-startup>1</load-on-startup> so it will be always be the first
servlet loaded. Then when you need to change a parameter you simply change
it once and restart Tomcat.
Jim Urban
Product Manager
Netsteps Inc.
Suite 505E
1 Pierce Pl.
Itasca, IL 60143
Voice: (630) 250-3045 x2164
Fax: (630) 250-3046
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 14, 2001 4:38 PM
To: [EMAIL PROTECTED]
Subject: Multiple servlets using same initParameters
I have multiple servlets in the same directory and they all get the same
init-params from web.xml.
Currently, I have 5 servlets and am required to repeat all the init-params
5 times, one for each servlet. So if one parameter changes, I have to
change it five times in web.xml. I'd like to only have them in the web.xml
file once and all servlets use them. How is this possible?
One approach I took was to create a servlet that all my other servlets
subclassed and all it did was grab the init-params. I couldn't get it to
work.
Any ideas?
Thanks,
JEB