users@jsr311.java.net

Re: Supporting Link: header?

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Tue, 04 Aug 2009 08:58:10 -0400

On Aug 4, 2009, at 2:02 AM, Michael Hausenblas wrote:
>
> When reading the Appendix B of v1.1 of the Editors Draft of JAX-RS,
> I was
> wondering if there is *any* chance that the Link: header will be
> supported
> as well (pls. forgive me if this has been discussed already - failed
> to find
> it in the ML archive). Point is that we are implementing a LRDD-based
> service [1] and would be willing to switch to JAX-RS, given this
> header is
> supported.
>
> Let me ensure you that I'm very happy to see your great work re a
> Java/REST
> interface happening; eventually a real alternative to RoR, etc.
>
While there isn't currently a specific method in ResponseBuilder for
the Link header, its still easy to support using:

ResponseBuilder.header("Link", headerValue)

where headerValue is an instance of any class whose toString method
produces a suitable string value for the header.

Its probably a little early in the life of the Link header (its still
an IETF working draft) to bake anything specific for it into the API:
if the draft changes significantly then backwards compatibility
requirements on the API could make it awkward to evolve the API.

Regards,
Marc.