users@jersey.java.net

Re: [Jersey] Jersey client and collection resources

From: Aaron Bruegl <abruegl_at_nighthawkrad.net>
Date: Fri, 24 Oct 2008 07:16:05 -0500

Thank you for pointing this out, it is working now. Thanks also to
everyone who is working on Jersey, it is a great product!


Arul Dhesiaseelan wrote:
>
> Aaron Bruegl wrote:
> > How can I use the Jersey client api to get a Collection? For example
> > how would you do a get of the example
> > jersey-samples-1.0/jaxb/collection/XmlRootElement?
> >
> You can find the below test case distributed with the sample which uses
> Jersey client to get the collection from JAXBCollectionResource.
>
> public void testRootElementCollection() {
> GenericType<Collection<JAXBXmlRootElement>> genericType = new
> GenericType<Collection<JAXBXmlRootElement>>() {};
> Collection<JAXBXmlRootElement> ce1 =
> r.path("jaxb/collection/XmlRootElement").get(genericType);
> Collection<JAXBXmlRootElement> ce2 =
> r.path("jaxb/collection/XmlRootElement").type("application/xml").post(genericType,
> new GenericEntity<Collection<JAXBXmlRootElement>>(ce1){});
> assertEquals(ce1, ce2);
> }
>
> HTH,
> -Arul
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>


-- 
Aaron Bruegl