Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 44189 invoked by uid 500); 21 Aug 2001 07:09:17 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 44177 invoked from network); 21 Aug 2001 07:09:16 -0000 Received: from mail.brocom.de (HELO ?195.30.191.114?) (195.30.191.118) by h31.sny.collab.net with SMTP; 21 Aug 2001 07:09:16 -0000 Received: from mail.brocom.de by [195.30.191.114] via smtpd (for h31.sny.collab.net [64.208.42.41]) with SMTP; 21 Aug 2001 07:08:03 UT Received: from raptorii.brocom.de ([192.168.1.105]) by mail.brocom.de (8.10.0/8.10.0) with SMTP id f7L5pqg25188 for ; Tue, 21 Aug 2001 07:51:52 +0200 Message-ID: <3B820905.B7FB0A2A@brocom.de> Received: from no.name.available by raptorii.brocom.de via smtpd (for mail.brocom.de [195.30.191.118]) with SMTP; 21 Aug 2001 07:08:01 UT Date: Tue, 21 Aug 2001 09:08:53 +0200 From: "P.Miller" Organization: Brockhaus/Commission GmbH X-Mailer: Mozilla 4.73 [en] (Win95; U) X-Accept-Language: cs,de,en,sq,be,zh-CN,zh-TW,hr,da MIME-Version: 1.0 To: tomcat-user@jakarta.apache.org Subject: Re: New to servlets: Parameter initialisation in web.xml References: <20010820135301.57078.qmail@web10301.mail.yahoo.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mail.brocom.de id f7L5pqg25188 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Hi chris, specified in a tag in the web.xml- context can be made available via the ServletConfig.getInitParameter("name"). If you put them in in the they can be made available via the ServletContext object (instead of the ServletConfig as above) --> ServletContext sc =3D ServletConfig.getServletContext() sc.getInitParameter("name") Hth Peter chris hutchings wrote: >=20 > Hi, > Thanks for the replies, but perhaps I was a bit vague > in my description. >=20 > I have written a couple of example servlets which I > placed in the \webapps\ROOT\WEB-INF\classes folder, > and these work ok >=20 > The next example that I tried involved setting an > parameter in web.xml (for a counter) and > a servlet that would use this value. > (all copied out of a book) >=20 > Since I was using the \webapps\ROOT\WEB-INF\classes > folder for my servlets, I altered the web.xml in > /ROOT/WEB-INF. >=20 > The servlet executed ok, but the variable was not > initialised =96 I printed it out an it was =91null=92 >=20 > i.e. the servlets executing from > \webapps\ROOT\WEB-INF\classes can not see the params > specified in ROOT/WEB-INF/web.xml. >=20 > hmm, why is this? >=20 > i can now get the supplied examples to work,. >=20 > thanks chris. >=20 > ____________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk > or your free @yahoo.ie address at http://mail.yahoo.ie