users@jersey.java.net

Re: [Jersey] Post entity with Webresource

From: Naresh <Srinivas.Bhimisetty_at_Sun.COM>
Date: Fri, 11 Sep 2009 11:57:05 +0530

Hi,

xworker wrote:
> Hi
>
> Im trying to do a simple post with an entity from my backingbean to my REST
> ws service.
>
> Something like this:
>
> webresource.post(ClientResponse.class, myEntity);
>
> Whats the correct way of doing this?
you can definitely do it this way.
> All the examples I've seen just send
> strings and not entitys.
>
Please refer the JAXB sample's [1] MainTest class. Most of the test
methods of this test class, use post() method for actually POSTing entities.

[1]
http://download.java.net/maven/2/com/sun/jersey/samples/jaxb/1.1.3-ea-SNAPSHOT/jaxb-1.1.3-ea-SNAPSHOT-project.zip

-Naresh
> /xw
>