users@jax-rs-spec.java.net

[jax-rs-spec users] Re: Adding links using ContainerResponseFilter

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Wed, 20 Feb 2013 18:24:09 +0100

You can use

context.getHeaders().add(HttpHeaders.LINK, myLink);

HTH,
Marek

On Feb 19, 2013, at 3:24 PM, Santiago Pericas-Geertsen <santiago.pericasgeertsen_at_Oracle.com> wrote:

>
> On Feb 19, 2013, at 7:17 AM, Jan Kronquist <jan.kronquist_at_jayway.com> wrote:
>
>> Hi
>>
>> I am experimenting using a ContainerResponseFilter to add additional links using reflection. However, in Jersey2.0-m12-1 it is not possible to modify the links since the set is unmodifyable. The javadocs of ContainerResponseContext.getLinks does not indicate that the list is not modifyable. Is this the intended behavior?
>>
>> In that case what is the purpose of the ContainerResponseContext.getLinkBuilder method?
>>
>> Is it possible to add links using some other mechanism?
>
> I need to double-check this, but we certainly want to support this use case. Perhaps getLinks should return a mutable set ...
>
> -- Santiago
>