Hi everyone,

I'm using Restlet on the server side and Restlet-GWT on the client
side.  I'm having difficulties getting a Status and LocationRef to
filter through from the server to the client.

On the server side, I am doing the following:

@Override
public void storeRepresentation(Representation entity) throws
ResourceException {
    addSomething();
    getResponse().setLocationRef(getRequest().getResourceRef().getBaseRef()
+ "/" + newObject.getId());
    getResponse().setStatus(Status.SUCCESS_CREATED);
}

On the client side, I am doing the following:

@Override
public void onEvent(Request request, Response response) {
    Window.alert("Status code: " + response.getStatus().getCode() +
"\nLocation: " + response.getLocationRef());
}

Restlet-GWT is always receiving a Status of 200 (instead of 201) and a
LocationRef of null (instead of the location of the newly created
object).

Has anyone else experienced this issue?  I am using GWT Hosted Mode at
the moment (with the GWTShellServlet and GwtShellServletWrapper) -
could this be the issue?

Any help greatly appreciated :-)

Thanks,

Damian

Reply via email to