Ok, i've implemented this minus the @Body thingy. Not sure how I want
to handle that.
Bill Burke wrote:
> I'm going to rewrite the @FormValues functionality that Ryan added.
> These will be the changes:
>
> * @FormValues renamed to @Form
> * org.jboss.resteasy.annotations.FormParam is redundant, spec now has a
> @FormParam annotation
> * @Form will only be a parameter, method, field annotation and used like
> any other @*Param annotation.
> * There will be no provider for it, instead it will be its own
> ParameterInjector
> * You can use any @*Param annotation within the @Form class you are
> injecting on any setter method, field, or constructor param of that class.
> * I'll add a new @Body annotation that allows you to inject a message
> body into a property of the form class.
>
> Here's an example:
>
> public class MyForm {
>
> @FormParam("foo")
> int foo;
>
> @HeaderParam("myHeader")
> public void setMyHeader(double val) {...}
>
>
> public MyForm(@Context Request request) {...}
>
> }
>
>
> @Path("/")
> public class MyResource
> {
>
> @POST
> public void post(@Form MyForm form) {...}
> }
>
>
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
|