You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Liu, Xiaoyan" <xl...@CapitalThinking.com> on 2002/06/05 19:54:27 UTC

forwarding wrapped request:lost parameter???

Hi,

I have a question about request forwarding. 

We use three filters in the chain, the very first filter
wraps HttpServeletRequest( it extends HttpServletRequestWrapper)
and passes down the chain. The third filter forwards
the request to different jsp pages based on user input.

What we have experienced is that sometimes the wrapped
request is missing posted parameters while calling 
'getParameter' on the original one (non-wrapped) returns
sth. This happens in a random fashion.

question: which request tomcat forwards: wrapped one or
non-wrapped one? Is there sth we are not doing right?

thanks.


Liu
Capitalthinking.com

Re: forwarding wrapped request:lost parameter???

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 5 Jun 2002, Liu, Xiaoyan wrote:

> Date: Wed, 5 Jun 2002 13:54:27 -0400
> From: "Liu, Xiaoyan" <xl...@CapitalThinking.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: 'Tomcat Users List' <to...@jakarta.apache.org>
> Subject: forwarding wrapped request:lost parameter???
>
> Hi,
>
> I have a question about request forwarding.
>
> We use three filters in the chain, the very first filter
> wraps HttpServeletRequest( it extends HttpServletRequestWrapper)
> and passes down the chain. The third filter forwards
> the request to different jsp pages based on user input.
>
> What we have experienced is that sometimes the wrapped
> request is missing posted parameters while calling
> 'getParameter' on the original one (non-wrapped) returns
> sth. This happens in a random fashion.
>
> question: which request tomcat forwards: wrapped one or
> non-wrapped one? Is there sth we are not doing right?
>

The request that is seen by the forwarded-to servlet is the request
wrapper that your application created -- Tomcat implements request
dispatcher forwarding with a wrapper of it's own, but this is placed
underneath any application-provided wrappers.

One way to cause the problem you are seeing is if your wrapper overrides
getParameter() and doesn't delegate it to the "real" request that it is
wrapping.  If that is happening to you, then it's a bug in your wrapper.

> thanks.
>
>
> Liu
> Capitalthinking.com
>

Craig



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>