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

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

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Thu, 8 Mar 2012 01:00:56 +0100

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?
>>
>>
>>