Hello Bjorn,

>I tried that from scratch, but it just returns a java object.
This could come from the classpath of the server application.
The ability to convert an Object to a perticular type of representation is
given via Restlet extensions (see this page for more details about the
Converter [1]) simply put in the classpath of the application (with their
dependencies).For example the "org.restlet.ext.json" extension allows to
generate on-the-fly json representation of Java bean.
So, I wonder what kind of extensions are you using for your application?

Best regards,
Thierry Boileau



[1]
http://wiki.restlet.org/docs_2.1/13-restlet/27-restlet/331-restlet/360-restlet.html

2011/1/15 Bjorn Roche <[email protected]>

> I think the issue was that I did not define my function to take a Form
> argument. It seems to work now:
>
> @Post("form")
> public Representation post(Form form) {
> ...
> }
>
> FYI: I was unclear what the post annotation argument referred to, the
> content-type in the Accept header of the request (which is what I thought,
> but is not correct) or the content-type of the request entity.
>
> I am not sure if this was missing from the docs or if I'm just overwhelmed
> by too much information, but it could stand to be in the tutorials.
>
>
> While I'm on the topic of the Docs (sorry to get off thread topic), this
> document shows an example of returning either JSON or XML or other types
> apparently on demand:
>
>
> http://wiki.restlet.org/docs_2.1/13-restlet/21-restlet/318-restlet/303-restlet.html
>
> I tried that from scratch, but it just returns a java object. I'm clearly
> missing something. I'll figure it out, or I'll start another thread topic
> when I can figure out a specific question, but I think the tutorial is
> missing some magic -- eg how does the Java object get converted to
> XML/JSON/whatever?
>
> Again, I could be missing something obvious because I'm overwhelmed with
> GAE, Servlets and so on, but it seems like an amazing feature I'm missing.
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2698200
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2700389

Reply via email to