rushead [
https://community.jboss.org/people/rushead] created the discussion
"RestEasy PostProcessInterceptor chain not traversed if response is created by
ExceptionMapper"
To view the discussion, visit:
https://community.jboss.org/message/744157#744157
--------------------------------------------------------------
Hi all.
A little explanation before:
I had a problem with my custom logging implementation (based on a ServletFilter) which is
caused by the fact that the HttpHeader entries are applied at the HttpServletResponse
right before the message body is written.
Therefore I wanted to implement a PostProcessInterceptor which applies the necessary
HttpHeader entries, which are already contained in the ServerResponse, at the injected
HttpServletResponse.
If the resource does not throw an exception my implementation works as expected.
If an exception is thrown and an ExceptionMapper is creating the response, the
PostProcessInterceptor chain is not traversed.
In my opinion the problem is caused by the following line in resteasy-jaxrs:
https://github.com/resteasy/Resteasy/blob/master/jaxrs/resteasy-jaxrs/src...
https://github.com/resteasy/Resteasy/blob/master/jaxrs/resteasy-jaxrs/src...
The interceptor chain is not applied to the created Response before writing / sending it.
My question is now:
Is this an expected behavior? In my opinion the interceptor chain should be traversed in
every case.
I didn't create a new issue in the resteasy jira because I'm not sure if this
behavior is expected.
My current workaround:
Currently I create the interceptor, inject the properties and add it to the response
within my abstract ExceptionMapper implementation. (<-- quite ugly, I know...)
Thanking you in anticipation.
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/744157#744157]
Start a new discussion in JBoss AS 7 Development at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]