I have had problems with the servlet being used in two different web-applications. This would cause two initializations of two different instances...
 
There should be something in the Context/whatever is passed to the init method that you could check for this. Or print out "this" and see if the memory addresses of the two instances are the same or different. (Or, it could possibly be a bug in tomcat where someone didn't protect the concurrent initialization, where if a second request for the servlet comes before the first call to the init method returns it starts a different call to init in a different thread...)
 
Good luck,
Jason B.
 
-----Original Message-----
From: Irina Rubenchik <[EMAIL PROTECTED]>
To: Parayali, Jayesh 1065 <[EMAIL PROTECTED]>
Cc: tomcat-user <[EMAIL PROTECTED]>
Date: Friday, December 08, 2000 11:48 AM
Subject: Re: running init() twice?

I'm running on winNT, and I do have print statements in my init(). This is how I see that it is being called for both frames.

"Parayali, Jayesh 1065" wrote:

 

are you running on winNT?
try displaying something inside init()
like System.out.println("now starting init....");

    -----Original Message-----
    From:   Irina Rubenchik [SMTP:[EMAIL PROTECTED]]
    Sent:   Thursday, December 07, 2000 9:36 AM
    To:     Parayali, Jayesh 1065
    Subject:        Re: running init() twice?

    Then how come it is called twice?

    "Parayali, Jayesh 1065" wrote:

       

      init will be called only once.. you don't need to set anything.

              -----Original Message-----
      From:   Irina Rubenchik [SMTP:[EMAIL PROTECTED]]
      Sent:   Thursday, December 07, 2000 6:37 AM
      To:     tomcat-user
      Subject:        running init() twice?

              Hello,

              I have a web page with 2 frames. Both frames invoke one servlet with
      different parameters. When I run this servlet, it seems like it is
      executing the init method twice, once for each frame. Is there an option

              that I can set in tomcat, which would make sure that the init method of
      my servlet only invoked once?

              Thanks
      irina << File: Card for Irina Rubenchik >>

     << File: Card for Irina Rubenchik >>

Reply via email to