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

[jsr339-experts] Re: Response headers are writable without a builder

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Thu, 8 Mar 2012 09:56:32 +0000

Hi Marek, I'm referring to Response.getMetadata() Java docs...

Thanks, Sergey
On 08/03/12 00:00, Marek Potociar wrote:
>
>
> Marek
>
> On 6. 3. 2012, at 23:34, Sergey Beryozkin<sberyozkin_at_talend.com> wrote:
>
>> On 05/03/12 15:56, Bill Burke wrote:
>>> Another thing that sucks about Response, ResponseBuilder, and modifying
>>> them in filters is that Response.getMetadata() allows you to modify the
>>> headers directly on the Response. The separation between reading and
>>> writing that a Builder is supposed to give you is broken.
>>>
>> Yes, this does not look right.
>> if it is the case then the following is possible from the application code:
>>
>> Response r = Response.ok().header("a", "b").build();
>> r.getMetadata().set(...);
>
> ...throws exception...
>
> Marek
>>
>> Sergey
>>
>>> So why do we still insist on forcing this Builder pattern for everything
>>> else other than Response headers?
>>>
>>>
>>>