You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Erik Price <ep...@ptc.com> on 2003/01/23 22:10:23 UTC

Filter doing a redirect

I wrote a filter, which performs a redirect *before* calling 
doFilterChain().  It is mapped to "/main.jsp".  I was hoping that this 
would cause the redirect to occur *before* calling main.jsp, but that 
appears not to be the case.  Does the redirect occur afterward even 
though I have not yet called doFilterChain() in my filter when I call 
the redirect?


Thanks,

Erik



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


Re: Filter doing a redirect

Posted by Bill Barker <wb...@wilshire.com>.
Calling response.sendRedirect sets the HTTP status code to 302, and
populates the 'location' response header.  You almost always simply want to
'return;' from your Filter in this case (since the response is complete),
rather than proceed with doFilterChain.

"Erik Price" <ep...@ptc.com> wrote in message
news:3E305A3F.7080508@ptc.com...
> I wrote a filter, which performs a redirect *before* calling
> doFilterChain().  It is mapped to "/main.jsp".  I was hoping that this
> would cause the redirect to occur *before* calling main.jsp, but that
> appears not to be the case.  Does the redirect occur afterward even
> though I have not yet called doFilterChain() in my filter when I call
> the redirect?
>
>
> Thanks,
>
> Erik




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