Question on filter chaining

8 views
Skip to first unread message

Avlesh Singh

unread,
Jun 10, 2009, 5:37:57 AM6/10/09
to urlre...@googlegroups.com
I have a bunch of filters configured in my webapp, the UrlRewrite filter being the first one in the chain.
I noticed a strange behavior, url's that were rewritten bypassed all the subsequent filters. On looking into the UrlRewriteFilter source, I spotted this code

if (!requestRewritten) {
  chain.doFilter(hsRequest, urlRewriteWrappedResponse);
}

I am trying to understand what does this mean. Should UrlRewrite be the last filter in the chain? If yes, why? As in, why should all other filters be skipped when the url is rewritten?

Cheers
Avlesh

Wim De Smet

unread,
Jun 11, 2009, 3:57:15 AM6/11/09
to urlre...@googlegroups.com
Hi,

I'm not sure about the why (I assume re-parsing request parameters
etc) but rewritten urls get FORWARD'ed. This is why you'll have to
make other filters listen on FORWARD if you want them to get hit after
rewriting.

regards,
Wim

Reply all
Reply to author
Forward
0 new messages