tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: A threading question!
Date Thu, 06 Jul 2000 17:16:20 GMT
Lucas Ludvig wrote:

> What do you mean when you say that using the response object outside of the
> service method is undefined?  I am doing this and I am finding it difficult
> to keep simultaneous response objects from outputting to the wrong browser.
> Thanks,

"Undefined" means that what happens is totally unpredictable and
dependent on
the particular way your servlet container implements its request and
objects.  Correct servlet applications do not allow access to these
objects from
outside the thread that is actually processing that request/response
pair, and
they do not save references to these objects for later use elsewhere.

In the case of Tomcat, you are absolutely guaranteed that you will screw
up if you do this, because Tomcat recycles the request and response
objects for
subsequent requests from other users.

> Luke

Craig McClanahan

> >Also, I wanted to caution you not to try to use the
> >Response object outside of the service() method of the servlet (doGet() and
> >doPost() are part of service()), as this is undefined.
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at
> --------------------------------------------------------------------------
> To unsubscribe, email:
> For additional commmands, email:

View raw message