hi, I would like to conclude my findings:
Disclaimer - the findings are based on the current snapshot (which includes the patched XStream lib for GAE) 1. AJAX libs: most AJAX implementations will urlencode the body of a POST action. Due to a current limitation of the Restlet XStream extension (which does not support decoding of representations in application/x-www-form-urlencoded format) Restlet will fail to translate json representation into java domain objects. 2. The usage of AJAX libs that support suppressing the encoding of the POST body will be treated as expected on the server side. You should check the AJAX lib API for that capability. 3. the JSE-Restlet client and I assume that the android Restlet client will leave the body un-encoded so the Restlet server can translate the JSON object into the Object representation without a problem. 4. The GWT-Restlet client encodes the body of the POST operation using application/x-java-serialized-object+gwt format. It should work fine since the Restlet provides a server side module that can decode this representation. Final note - using ajax to send PUT operations (or any other method except POST/GET) might fail in some browsers. As a result the tunneling feature of Restlet is a good solution: a) add the following to the end of the RESTful URL: ?method=PUT. Please note that PUT must be upper case only!! it fails otherwise!! b) make sure that tunneling is turned on and that method tunneling is enabled. Thanks, Chen. On Tue, Apr 13, 2010 at 16:48, Thierry Boileau <[email protected]>wrote: > Hi Chen, > > > >Can you elaborate a bit more about how exactly > >should I register the patched Converter? > In the case of the XStream extension, there is nothing to do, since this > extension already declares the converter. What is patched, is the XStream > library. > I wanted to say, but I see it was a little bit confusing, that in case you > want to perform your own conversion (from Web Form to Item class, for > example) you have to provide your own converter: > - inherits from ConverterHelper > - create a "org.restlet.engine.converter.ConverterHelper" file in > src/META-INF/services/ with a single line of text wich is the full path to > your converter. > > >ok I will try to work with the patched converter > >although I must say that this should really be part of Restlet > We are really hoping the xstream team will fix this issue in a future > version. If not, the xstream library won't be part of the GAE edition as we > don't want to maintain unofficial versions of extension libraries. > > >for cases such as JSON submitting via Web Forms. > Do you mean "send JSON representations inside a classical Web form"? > > Best regards, > Thierry Boileau > > ------------------------------------------------------ > > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2580833 > ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2581465

