users@jersey.java.net

Re: [Jersey] Location Header

From: Bruno Luiz Pereira da Silva <blpsilva_at_gmail.com>
Date: Mon, 12 May 2008 08:30:35 -0300

Hi, I want to return the absolute URI corresponding to /products/{id}, but I
wanted to use a relative URI in Response.created(uri).

I managed to return the URI I want using UriInfo. I just didnt't want to
manipulate the HttpRequest directly. I'm now using UriInfo.getBaseUri + my
relative URI. This is working just fine, I'm happy now :)

Regards,

Bruno

On Mon, May 12, 2008 at 4:46 AM, Martin Probst <mail_at_martin-probst.com>
wrote:

> I'd like to be able to set the Location header to /products/{id} using a
> > relative URI, even inside a different path (/user in this case). Do you
> > think it makes sense or am I willing to do something inadequate?
> >
>
> What do you want to have returned to the browser?
>
> If you're asking for a relative Location header in the actual response,
> e.g.
>
> Location: /products/12
>
> This is illegal wrt the HTTP standard, Location headers must always be
> absolute.
>
> Regards,
> Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>


-- 
Atenciosamente,
Bruno Luiz Pereira da Silva
blpsilva_at_gmail.com
http://brunopereira.com.br