Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 86851 invoked from network); 11 Aug 2004 12:47:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 Aug 2004 12:47:34 -0000 Received: (qmail 89587 invoked by uid 500); 11 Aug 2004 12:47:02 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 89520 invoked by uid 500); 11 Aug 2004 12:47:01 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 89506 invoked by uid 99); 11 Aug 2004 12:47:01 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [63.244.250.132] (HELO mustang.mpi.com) (63.244.250.132) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 11 Aug 2004 05:47:00 -0700 Received: from lightning.mpi.com (lightning [63.244.252.11]) by mustang.mpi.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id i7BCgsnW017305 for ; Wed, 11 Aug 2004 08:42:55 -0400 (EDT) Received: from US-VS1.corp.mpi.com (us-be2.corp.mpi.com [63.244.252.32]) by lightning.mpi.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id i7BCkiT0013753 for ; Wed, 11 Aug 2004 08:46:55 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Help, why is my servlet calling init twice? Date: Wed, 11 Aug 2004 08:46:06 -0400 Message-ID: <9C5166762F311146951505C6790A9CF80229BE73@US-VS1.corp.mpi.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Help, why is my servlet calling init twice? Thread-Index: AcR/OkTegiRiPeazSRiGDxhYtekH9AAZtZdw From: "Shapira, Yoav" To: "Tomcat Users List" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, Also, if you have two tags in web.xml, two instances are guaranteed to be created and initialized by Tomcat. Yoav Shapira Millennium Research Informatics >-----Original Message----- >From: QM [mailto:qm300@brandxdev.net] >Sent: Tuesday, August 10, 2004 8:29 PM >To: Tomcat Users List >Subject: Re: Help, why is my servlet calling init twice? > >On Tue, Aug 10, 2004 at 05:16:24PM -0500, Randy Paries wrote: >: If I remove the tag from the web.xml, then the first >time >: I call the servlet the init gets only called once > >What's your evidence that init() is being called twice? I'm after log >messages, etc. Are you sure the entire context (webapp) isn't being >loaded twice due to autoDeploy or loadOnStartup? > >btw, the servlet spec gives containers leeway to create as many >instances of a given servlet as they see fit; so your servlet may very >well be init()'d multiple times within a context's runtime. > >If you're using a servlet+ to perform some one-time >context initialization, look into ServletContextListener instead. It >was designed with that in mind. > >-QM > >-- > >software -- http://www.brandxdev.net >tech news -- http://www.RoarNetworX.com > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org