The org.restlet.data.Form instance is created automatically from the entity.
Run this demo server:

http://pastebin.com/G0t4ExYP

and use whatever submission technique you choose (see the curl suggestion in
the class comment) to post some data, and you can verify that it works
without any special configuration.

--tim


On Mon, Aug 8, 2011 at 10:18 AM, Paul Morris <[email protected]> wrote:

> It's a publicly exposed HTTP call so I won't be getting an
> org.restlet.data.Form passed in. I'll be getting an entity body with params
> as in:
>
> param=value&otherparam=value
>
> Paul Morris
>
> On Aug 8, 2011, at 8:32 AM, "Tim Peierls" <<mailto:[email protected]
> ><mailto:[email protected]>[email protected]<mailto:[email protected]>> wrote:
>
> I'm probably missing something, but why isn't the following acceptable?
>
> @Post public Representation doPost(Form form) {
>    // do stuff with form
> }
>
> --tim
>
> On Sun, Aug 7, 2011 at 11:54 PM, Paul Morris <<mailto:[email protected]
> ><mailto:[email protected]><mailto:[email protected]>[email protected]<mailto:
> [email protected]>> wrote:
> I might also mention that I'm trying to keep my bean from being Spring
> aware so I'm looking for the solution that is as least Spring-invasive as
> possible. Thanks.
>
> > This may be more of a Spring question than a Restlet question but can
> someone advise on the best way to handle the following in Restlet/Spring:
> >
> > I want to create a Form dynamically when a POST is called as in:
> >
> > @Post
> > public Representation doPost(Representation entity) {
> >     Form form = new Form(getRequestEntity());
> >     // do stuff with the parameters in the form
> > }
> >
> > But how do I inject the Form into my ServerResource object in the Spring
> context file since it won't have what it needs (namely the requestEntity) to
> get instantiated until after the POST gets called?
>
> ------------------------------------------------------
> <
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2812411
> ><
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2812411
> ><
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2812411
> >
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2812411
>
> This message and any included attachments are intended only for the
> addressee. The information contained in this message is confidential and may
> constitute proprietary or non-public information under international,
> federal, or state laws. Unauthorized forwarding, printing, copying,
> distribution, or use of such information is strictly prohibited and may be
> unlawful. If you are not the addressee, please promptly delete this message
> and notify the sender of the delivery error by e-mail.
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2812526

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

Reply via email to