users@jersey.java.net

Re: [Jersey] form to pojo

From: Trolly Rogers <trolly.s.rogers_at_gmail.com>
Date: Fri, 19 Feb 2010 00:14:09 -0500

Greatly appreciate, Paul.

On Tue, Feb 16, 2010 at 4:11 PM, Paul Sandoz <Paul.Sandoz_at_sun.com> wrote:

> Hi Trolly,
>
> You can do this:
>
> public class MyFormBean {
> @FormParam("x") String s;
> @FormParam("y") String y;
> }
>
> @Path("/")
> public class MyResource {
> @POST
> public void post(@Inject MyFormBean f) {
> ...
> }
> }
>
> The same construction/injection rules apply to MyFormBean as they do for
> any resource class.
>
> Hth,
> Paul.
>
> On Feb 16, 2010, at 6:17 PM, Trolly Rogers wrote:
>
> Hi All - I think I'm overlooking something obvious in the Jersey
> documentation. Is there any out of the box way for Jersey to bind a posted
> form to a pojo? I'm convinced there is, I just can't find any info on it.
>
> The link below is what I'm looking to do (minus the custom message body
> reader coding).
>
>
> http://wikis.sun.com/display/Jersey/getting+form+data+as+a+populated+javabean
>
>
>