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 64053 invoked from network); 19 Aug 2000 09:34:47 -0000 Received: from pimout3-ext.prodigy.net (HELO pimout3-int.prodigy.net) (207.115.63.102) by locus.apache.org with SMTP; 19 Aug 2000 09:34:47 -0000 Received: from synera427 (NYCMA010-0056.splitrock.net [209.255.49.56]) by pimout3-int.prodigy.net (8.10.1/8.10.1) with SMTP id e7J9Ymj132096 for ; Sat, 19 Aug 2000 05:34:48 -0400 Message-ID: <005f01c009c0$8f4c7fa0$3831ffd1@prodigy.net> From: "ALEXANDROS KOTSIRAS" To: References: <00b101c0096d$71bf6db0$76bd1990@us.oracle.com> Subject: Re: Init method of the servlet getting called five times Date: Sat, 19 Aug 2000 05:33:39 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_005C_01C0099F.07BC39C0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_005C_01C0099F.07BC39C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Maybe this is not the reason in your case but in general if you are = using inheritance with your servlets, every time that=20 the init() method of a child Servlet is called it will always call first = the init() method of the parent Servlet even if the parent Servlets = init() was called before. So if you have 5 child servlets your parent = servlet's init() will be called at least 5+1 times. This behavior though = should be identical on JServ and Tomcat. Alex. ----- Original Message -----=20 From: Harish Rawat=20 To: tomcat-user@jakarta.apache.org=20 Sent: Friday, August 18, 2000 7:38 PM Subject: Init method of the servlet getting called five times I saw a strange behaviour in tomcat. While loading a servlet it calls = the init method five times (and the destroy method is not called), = whereas with Jserv for the same servlet the init method is called only = once. Any reasons why this could be happening? Thanks Harish ------=_NextPart_000_005C_01C0099F.07BC39C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Maybe this is not the reason in your case but in general if = you  are=20 using inheritance with your servlets, every time that
the init() method of a child Servlet is called it will always call = first=20 the init() method of the parent Servlet even if the parent Servlets = init() was=20 called before. So if you have 5 child servlets your parent servlet's = init() will=20 be called at least 5+1 times. This behavior though should be identical = on JServ=20 and Tomcat.
 
Alex.
----- Original Message -----
From:=20 Harish Rawat
To: tomcat-user@jakarta.apache.org=
Sent: Friday, August 18, 2000 = 7:38=20 PM
Subject: Init method of the = servlet=20 getting called five times

I saw a strange behaviour in tomcat. = While=20 loading a servlet it calls the init method five times (and the destroy = method=20 is not called),  whereas with Jserv for the same servlet the init = method=20 is called only once.
 
Any reasons why this could be=20 happening?
Thanks
Harish
------=_NextPart_000_005C_01C0099F.07BC39C0--