On Tue, 3 Jul 2001, Jari Worsley wrote:

> Vincent Massol wrote:
> > Ok, here is the story ... :)
> > 
> > 1/ If you look at the Tomcat implementation (for Tomcat 3.x and before
> > only - It is fixed for later version as they had to fix this to support
> > Servlet 2.3 Filters), you'll see that the forward() and include() methods do
> > a cast of the request object to their own internal object. As the Request
> > wrapper does not implement this internal object, it fails.
> 
> fyi: I am using Resin 1.2.3 and get the same problem, so it looks like
> Resin suffers from the same problem as Tomcat 3.x
> 

Just for the record, in Servlet 2.2 containers it is *not* legal at all to
wrap the request and response objects passed to a RequestDispatcher.  
That is why many container implementations of the 2.2 spec use a cast back
to their own internal implementation objects -- they are relying on this
prohibition.

In the 2.3 spec, this requirement was relaxed -- but the wrapped request
and/or response objects you provide *must* implement the provided
ServletRequestWrapper or ServletResponseWrapper interfaces.  This
requirement exists so that the container can always follow the chain of
wrappers back to the original request or response implementation object if
it needs to.

Craig McClanahan

Reply via email to