> From: cristi [mailto:[EMAIL PROTECTED]
> Is there any way to make a copy of an object implementing
> the HttpServletRequest interface ?
Alter the Tomcat codebase to implement that copy facility, remembering
to check through the codebase for pieces that would break. You would
then be maintaining your own version of Tomcat. However, see below for
why this is not a good idea.
> I have thought that maybe using HttpServletRequestWrapper could
> solve my problem but I'm not sure since the API does not specify
> if a new copy of the object sent to the constructor is created
> or not.
It doesn't, and this probably wouldn't help you even if it did. If the
object was a shallow copy, then many of its dependent objects would be
shared with the Request from which it was copied; this means that you
would probably lose some context when the original Request was recycled.
If the object was a deep copy, then it would have its own copy of all of
the relevant fields - its own session and so on. So you would have to
experiment in order to copy exactly the correct fields to exactly the
correct depth - and then the next version of Tomcat might change
something that caused your approach to fail, so you would almost
certainly have to pick a version and stick with it.
Can you tell us what you are trying to achieve? There is almost
certainly an alternative way of getting to the same end without having
to copy requests but, until you give us a bit more detail, we can't help
you.
- Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]