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: Tue, 6 Mar 2012 22:34:15 +0000

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(...);

Sergey

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