Hi Rob,
That worked a treat. Thanks! :-)
Code which looks like the following ensures a Status and LocationRef
are picked up in Restlet-GWT:
@Override
public void storeRepresentation(Representation entity) throws
ResourceException {
addSomething();
getResponse().setEntity(new StringRepresentation("Not to be done
in production."));
getResponse().setLocationRef(getRequest().getResourceRef().getBaseRef()
+ "/" + newObject.getId());
getResponse().setStatus(Status.SUCCESS_CREATED);
}
Thanks again,
Damian
2008/11/16 Rob Heittman <[EMAIL PROTECTED]>:
> Hi Damian,
> This is due to an issue in the embedded Tomcat server used in GWT Hosted
> Mode. When sending a redirect, you must (ignoring the Restlet warning to
> the contrary) supply some sort of entity. Otherwise, the hosted mode Tomcat
> server will replace it with a generic 200 response. It's not clear yet
> whether the actual problem is in the original Tomcat bits or in the Google
> changes thereto. We may have to put a workaround into Restlet meanwhile,
> because it's quite annoying.
> For now, just attach something like a new StringRepresentation of "I am
> working around the hosted mode entity bug" to your redirects, and it should
> resolve the problem. Personally, I have a system property I set that
> triggers the workaround -- the property is set in my hosted mode launcher,
> but not on the production server.
>
> - Rob
> On Sun, Nov 16, 2008 at 6:40 AM, Damian Harden <[EMAIL PROTECTED]> wrote:
>>
>> 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?
>
>