tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Crowther" <>
Subject RE: What is allowed to do with a HttpServletRequest ?
Date Thu, 14 Jul 2005 15:22:51 GMT
> From: cristi [] 
> I have a web application where I need to use in a second request the
> HttpServletRequest object sent to the same servelet in the first
> request.
> 	session.setAttribute( "FIRST_REQUEST_OBJECT", request );

Unsafe.  Servlet containers may re-use request objects between
invocations.  Can't remember for sure, but I think Tomcat does so.  So
your second request object may be identical to your first request

> It seems that it is not safe to do so. What can I do to 
> handle this situation ?

As Guillaume said: copy the state you need from the first request into
the session, rather than storing the entire request.

		- Peter

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

View raw message