users@jersey.java.net

Re: [Jersey] Hyperlinks in REST responses

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 29 Sep 2009 09:48:14 +0200

On Sep 29, 2009, at 7:07 AM, Tatu Saloranta wrote:

> On Mon, Sep 28, 2009 at 7:15 AM, Paul Sandoz <Paul.Sandoz_at_sun.com>
> wrote:
>> Hi Ara,
> ...
>> IMHO i think relative links in representations only make sense if
>> there is a
>> base URI in the representation from which those relative links can be
>> resolved (e.g. using XML base, but not all XML processors may
>> support that).
>
> Could it also be that since client does access specific resource, it
> also can use URL of that resource as the base? (which is how browser
> does it)

It can, but IMHO that i think that may depend on the media type.


> In fact, it would seem wrong (or at least unnecessary) for response
> itself to (have to) set XML:base. Or am I misunderstanding the problem
> here?
>

I guess i am referring more to a best practice. Try to make the
representation as self-describing as possible. I was using XML base as
an example if one wanted to avoid making all URIs explicitly absolute.

Paul.