users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Null response entity and writer providers

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Wed, 13 Mar 2013 13:38:41 +0000

Hi

If we have a null response entity (example, with "void" resource method
return types or Response having no entity set), do writer interceptors
still get a chance to change it ? I think yes, WriterInterceptorContext
has a setEntity() method,

but given WriterInterceptor chain delegates eventually to
MessageBodyWriter, I wonder what is the right answer there.

I guess the runtime should indeed let the writers process Response with
the empty entity, but stop short of delegating to MessageBodyWriter if
the response entity is null...

Sergey