users@jersey.java.net

Re: [Jersey] problem to return/get? location during tests with jersey-test-framework-grizzly

From: Frédéric Bouquet <bouquet.frederic_at_gmail.com>
Date: Thu, 20 May 2010 15:24:07 +0200

> URI uri = uriInfo.getAbsolutePathBuilder().path(myId).build();
> [...]
> ClientResponse cr = webResource.type("text/xml").post(ClientResponse.class,
> ...);

thx

>> Then, I want to get back this resource using the header Location. I
>> tryed to get :
>> - cr.getLocation()
>> - cr.getHeaders().getFirst("Location")
>> But both return null.
>>
>> How can I GET the resource created and pointed by the header Location ?
>
> The Location header should not be null if your resource method is returning
> the Response instance you present above. Are you sure your resource method
> is functioning correctly?

Finaly, I have found the problem : I had forgotten the path part of
the resource :)
Thank you for your help.

Fred