Hello,
I've made several tests, I send you a sample GWT application (with the gwt and
xstream server extensions) based on the restlet 2.0.3 gwt and jee editions.
The server resource is defined as follow:
public class ContactServerResource extends ServerResource {
@Get
public Contact represent() {
Contact result = new Contact();
result.setId((String) getRequestAttributes().get("contact"));
result.setName("Peter Frampton");
result.setAddress("3 guitarhero road");
return result;
}
}
When requested with curl, I get correct entities:
$> curl -H "Accept: application/json" http://localhost:8888/rest/contacts/123
{"org.restlet.test.gwt.shared.Contact":{"address":"3 guitarhero
road","id":123,"name":"Peter Frampton"}}
$> curl -H "Accept: application/xml" http://localhost:8888/rest/contacts/123
<?xml version="1.0" encoding="UTF-8" ?>
<org.restlet.test.gwt.shared.Contact>
<address>3 guitarhero road</address>
<id>123</id>
<name>Peter Frampton</name>
</org.restlet.test.gwt.shared.Contact>
$> curl -H "Accept: application/x-java-serialized-object+gwt"
http://localhost:8888/rest/contacts/123
//OK[4,3,2,1,["org.restlet.test.gwt.shared.Contact/2215204171","3 guitarhero
road","123","Peter Frampton"],0,5]
I hope this will help you.
Best regards,
Thierry Boileau
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2686261