You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Nikita Tovstoles <ni...@eviltwinstudios.net> on 2006/05/09 01:11:43 UTC

Does Tomcat reuse parameterMap?

In Tomcat, do multiple HttpServletRequest objects share same 
parameterMap instance? If so, and access to that instance is not 
synchronized, doesn't that mean that one request can get another 
requests parameters?

see http://sourceforge.net/mailarchive/message.php?msg_id=12468534

thanks
-nikita


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Does Tomcat reuse parameterMap?

Posted by Tim Funk <fu...@joedog.org>.
It can be reused - but it is only used in by a single request at a time. A 
single request is bound to a thread. So it is thread safe.

Now if you have listeners that is assigning the value of the map or the 
servlet request to something else. And that something else lives longer than 
the life of a request - then bad things will probably happen.

-Tim

Nikita Tovstoles wrote:

> In Tomcat, do multiple HttpServletRequest objects share same 
> parameterMap instance? If so, and access to that instance is not 
> synchronized, doesn't that mean that one request can get another 
> requests parameters?
> 
> see http://sourceforge.net/mailarchive/message.php?msg_id=12468534


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org