jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: [jax-rs-spec users] Re: Re: Re: Re: Re: Re: Fwd: [Resteasy-users] PostProcessInterceptors not invoked for responses created by ExceptionMappers

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Thu, 23 Aug 2012 14:50:51 -0400

On Aug 23, 2012, at 10:58 AM, Bill Burke wrote:

>
>
> On 8/23/2012 10:33 AM, Marek Potociar wrote:
>> Btw. I'm starting to think that perhaps we should really leave things as
>> they are specified now, just clarify the processing of a mapped
>> exceptions. IOW:
>>
>> * an exception is mapped only once per a single request-response
>> processing cycle (to prevent exception mapping loops)
>> * any exception thrown while processing a response created as a result
>> of previous exception mapping is treated as "unmapped", i.e. it is
>> propagated to the hosting IO container
>> * a response created from a mapped exception is run through the
>> response filter chain that is constructed based on a given
>> processing context. I.e. if a resource has been matched, then all
>> response filters applicable to the resource would be invoked; if a
>> resource has not been matched yet, only global response filters
>> would be invoked.
>>
>>
>> The above would ensure that all exceptions - from resources as well as
>> from providers - are treated consistently. Any subsequent exceptions
>> would be then treated consistently too.
>>
>
> At the moment, I don't see any problems with the above. Good work Marek.

 I don't have a problem with this approach either. I thought there were concerns about "going back" in the processing chain (e.g., re-running the response filter chain after an exception is thrown in a response filter) and the potential for loops. Of course, as long as we state that an exception is mapped only once, this is taken care of.

 I'll double check and make sure the spec is crystal clear about this.

-- Santiago