From david.ferrero@zion.com Fri Aug 4 17:46:06 2000 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 64020 invoked from network); 4 Aug 2000 17:46:06 -0000 Received: from cx377469-a.mnchs1.ct.home.com (HELO mtzion.zion.com) (24.2.180.211) by locus.apache.org with SMTP; 4 Aug 2000 17:46:06 -0000 Received: from zion.com (IDENT:david@mtzion.zion.com [192.168.1.2]) by mtzion.zion.com (8.9.3/8.9.3) with ESMTP id NAA03592 for ; Fri, 4 Aug 2000 13:42:37 -0400 Sender: david.ferrero@zion.com Message-ID: <398B008C.CA5F90A3@zion.com> Date: Fri, 04 Aug 2000 13:42:37 -0400 From: "David J. Ferrero" Organization: Zion Software, LLC X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.12-20smp i686) X-Accept-Language: en MIME-Version: 1.0 To: tomcat-user@jakarta.apache.org Subject: Re: Global Parameters References: <398A6B16.2F9D2F99@gmx.de> <398AF488.53D78ACE@acm.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N This is what I'm trying to do. I can do this easily with a servlet as you say, but I'm wondering how to do this if my bootstrap is a Main.jsp? Tim Kientzle wrote: > > One common way around this sort of problem is to define a single > servlet parameter with the filename of a Java 'properties' file. > Look up java.util.Properties for how to load such a file. > > That lets you maintain a complex configuration without having to > edit web.xml every time. > > - Tim > > Rene Duettra wrote: > > > > >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"); > > > > > >Craig McClanaha > > ------------------------------------------------------- > > > > I used it this way. But how about accessing a servlet which has > > no init parameters BEFORE the servlet, which has one. > > If you try this: > > String paramValue = > > getServletContext().getInitParameter("paramName"); > > > > paramValue will be null... > > > > I think there is an easier way than defining all parameters > > for each servlet in the web.xml ... > > > > Thanks for answers. > > > > Rene -- ========================================================== ZION SOFTWARE, LLC http://www.zion.com ==========================================================