One way is to define this property in the web.xml as a <env-entry> and retrieve it using Context.lookup method. check web.xml and jndiservlet.java under the examples directory of your tomcat installation.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday,6 May 2002 17:02 To: tomcat users list Subject: How to pass a global parameter to all servlet of a webapp I have a webapplication which has 20/25 servlets, I have kept all global settings of the webapp in a property file and want to pass these property file path to all servlet . I came to know that for individual servlet I can define init parameters as foo bar But again defining these for all servlet is a problem, so I am looking for a settings which will be accessible to all servlet from a webapp. One way which I can think of is to pass argument to java using CATALINA_OPTS, but then it becomes accessible to all webapps. So please tell me if there is any way to have gloabl init parameters for all servlet/JSPs of a webapp? thanks Amol ------------------------------------------------------------------------------ This message and any attachment is confidential and may be privileged or otherwise protected from disclosure. If you have received it by mistake please let us know by reply and then delete it from your system; you should not copy the message or disclose its contents to anyone.
