tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reynir Hübner <rey...@hugsmidjan.is>
Subject RE: why Tomcat 4.0.4 creates new instance of servlet, when applet make first request to servlet?
Date Sun, 17 Nov 2002 14:31:40 GMT

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:expp@rol.ru] 
> Sent: 17. nóvember 2002 13:58
> To: tomcat-user@jakarta.apache.org
> 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:tomcat-user-unsubscribe@jakarta.apache.org>
> For 
> additional commands, e-mail: 
> <mailto:tomcat-user-help@jakarta.apache.org>
> 
> 

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message