users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Response headers are writable without a builder

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Wed, 7 Mar 2012 21:53:58 +0000

On 06/03/12 22:34, Sergey Beryozkin 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(...);
>
I just the docs as I became concerned I did not read the message till
the end. Actually I did :-), so -1 to having getMetadata() result
directly modifiable, the filters should work either with builders or
some other abstraction...

thanks

> Sergey
>
>> So why do we still insist on forcing this Builder pattern for everything
>> else other than Response headers?
>>
>>
>>