users@jersey.java.net

[Jersey] Servlet Filter and 405

From: <go_at_livemocha.com>
Date: Mon, 28 Nov 2011 16:59:29 +0000 (GMT)

Hello,

I have a servlet filter and Jersey generated 405 related question.
I have a filter with doFilter() method that adds extra header if it
detects a certain return code.

One thing I noticed is that when I issue a request that does not match
any resource, Jersey returns a 405. That's fine, but the response does
not go through a servlet filter chain, so my filter has no time to do
what it needs to do.

Is this expected?
I see the same behavior if I throw some exceptions like
NotFoundException.

It seems natural for me to expect any response generated by Jersey goes
through a filter chain on the way out with a response. Am I missing
something or is there any work around that somebody know about?

Thank you in advance,
Go