Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 11338 invoked from network); 3 Aug 2000 17:12:15 -0000 Received: from lexx.gmd-net.de (194.23.227.152) by locus.apache.org with SMTP; 3 Aug 2000 17:12:15 -0000 Received: from mail (mail.gmd-net.de 194.23.227.152) by lexx.gmd-net.de (8.9.3/8.9.3) with ESMTP id TAA04655 for ; Thu, 3 Aug 2000 19:12:14 +0200 Message-ID: <3989A90A.53C7259@gmd-net.de> Date: Thu, 03 Aug 2000 19:16:58 +0200 From: Wolfgang Stein X-Mailer: Mozilla 4.73 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: tomcat-user@jakarta.apache.org Subject: Re: global parameters Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N In cases where the Servlet Container doesn't already support Servlet API 2.2 e.g. Apache JServ or Oracle App Server you have to work around with System Properties. Set the Property in the Tomcat startup script with the -D option and retrieve it with System.getProperty("name"); But that's not clean because all contexts can access and change it. Wolfgang > -----Original Message----- > From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com] > Sent: Thursday, August 03, 2000 6:38 PM > To: tomcat-user@jakarta.apache.org > Subject: Re: global parameters > > > Rene Duettra wrote: > > > Hi, > > Normally I use web.xml to define parameters for servlets. > > Now I need to define some which should apply to all servlets. > > I think there is an easier way than defining all parameters > > for each servlet in the web.xml ... > > > > The easiest way to do this is to use context initialization > parameters, > rather than servlet initialization parameters. I don't have > the Servlet > 2.2 spec in front of me, but it's probably or > something > like that. > > In the servlet, you retrieve such a parameter like this: > > String paramValue = > getServletContext().getInitParameter("paramName"); > > > > > Thanks for answers. > > > > Rene > > Craig McClanahan >