tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: Multiple requests sharing the same Servlet instance
Date Wed, 16 Jun 2004 13:36:58 GMT


>But if a Servlet instance might be used by multiple threads at one
>then what's the point of having Servlet object pooling at all? Why

It might and it might not.  My point was that the Servlet Spec leaves it
for the container implementation to decide, and so you should be

>all requests just use one instance? I still don't see how I can have
>variables that are just for storing a single thread's working data. The

You can do so easily inside any method, or in ThreadLocal variables, or
in request-scope attributes, or in other non-servlet object pools that
you write (or use a 3rd party pooling library).  The ways are plentiful
and except for the request attributes they're not specific to servlet
containers (nor is this issue in general specific to servlet

>way I can do anything like this is to attach attributes to the request.
>this seems to be a kludge to me. I don't want to have to use Strings to
>to my data by way of a Map. I want regular Java local variables.

Address your comments, suggestions, etc. to the Servlet Specification
JSR team (it's JSR154).  I'm just telling you what the spec guarantees
and what it doesn't ;)


This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message