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.
A servlets runtime is within the scope of one request, so if you want to execute the 
same servlet twice, first to set member variables then with an applet and read from 
the member variables, I cannot see how it could be achived, exept maybe by using 
alternative methods, such as keeping the variables in servlet context, but not as 
member variables in the servlet.

Hope it helps
-reynir


> -----Original Message-----
> From: Daniil Ivanov [mailto:[EMAIL PROTECTED]] 
> Sent: 17. n�vember 2002 13:58
> To: [EMAIL PROTECTED]
> Subject: why Tomcat 4.0.4 creates new instance of servlet, 
> when applet make first request to servlet?
> 
> 
> Given:
> Tomcat 4.0.4 and servlet, that was already initialized when 
> browser made request to it.
> 
> When browser window with applet opens, applet begin 
> periodically query the servlet through standard method 
> doPost. But at the first request applet to servlet Tmcat 
> creates a new instance to servlet, in spite of that the 
> servlet was initialized before. I do't whant to have  a two 
> instances of servlet, because applet must get from servlet a 
> members of servlet class, that were already changed before by 
> previous request from browser (not from applet).
> 
> 
> 
> --
> 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