Thank Rob, but the constructor Reference(Reference, String) does not
seem to work, it actually produces a Reference instance that seem to
completely ignore the first argument.

More exactly, the following code:

   final String baseHref = "http://localhost:8080/app/api";;
   final String path = "group/1";
   final Reference ref = new Reference(new Reference(baseHref), path);
   System.out.println(ref);

prints "group/1" instead of  "http://localhost:8080/app/api/group/1";.

However, I've realized I can get the URL of the root restlet by
request.getRootRef(), so I'm able to construct the URL I need by
simply calling

   request.getRootRef() + "/group/1"

thanks

Pavel

On 16/12/2007, Rob Heittman <[EMAIL PROTECTED]> wrote:
>
> Hi Pavel,
>
> I'd start with the resource reference exposed by Request, and use the
> methods of the Reference object to do what you want, e.g.
>
> response.redirectTemporary(
>   new Reference(
>     request.getResourceRef().getParentRef().getParentRef(),
>     "group/" + groupId
>   )

Reply via email to