set <load-on-startup> in web.xml for your servlet. This will call init()
when tomcat is started as opposed to the first call. 

Are your applet and browser calling the same url? If you defined multiple
<servlet> definitions for your servlet in web.xml you will get separate
instances. Also if you have your context loaded twice: defined as a
<context> in server.xml and autoloaded.

Charlie

> -----Original Message-----
> From: Daniil Ivanov [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, November 17, 2002 9:48 AM
> To: Tomcat Users List
> Subject: Re:Re: why Tomcat 4.0.4 creates new instance of servlet, when
> applet make first request to servlet?
> 
> 
> 
> 
> 
> >
> > If I understand you correctly I think I must say a servlet get's
> initialized once, when it's loaded (by the classloader), and 
> then only again
> if it's changed.
> 
> It must be so in theory, but in fact I see, that when applet 
> request servlet
> (that was already initialized) at first time, the servlet 
> function init()
> automatically called, and only after that execute servlet 
> method doPost().
> So, the Tomcat creates new instance of servlet - because I 
> see, that the
> first instance of servlet(to which were requests only from 
> browser, not from
> applet) exists parallel to the new instance().
> At the following requests from applet to the servlet function 
> init() does't
> execute's and no new instances are created.
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to