<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Opera Husband &#187; JAXB</title>
	<atom:link href="http://blog.tmacsoft.com/tag/jaxb/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.tmacsoft.com</link>
	<description>Saving the world, one soprano at a time</description>
	<lastBuildDate>Thu, 24 Jun 2010 17:20:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Returning List in JAXB</title>
		<link>http://blog.tmacsoft.com/java/returning-list-in-jaxb</link>
		<comments>http://blog.tmacsoft.com/java/returning-list-in-jaxb#comments</comments>
		<pubDate>Tue, 06 Oct 2009 15:58:23 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[GenericEntity]]></category>
		<category><![CDATA[JAXB]]></category>

		<guid isPermaLink="false">http://blog.tmacsoft.com/?p=60</guid>
		<description><![CDATA[I was trying to figure out how to return a list in a response in JAXB.  The answer was here
Here&#8217;s a code snip

  @GET
  public Response getProducts(@QueryParam("active")String active,@QueryParam("family")String family,@Context UriInfo ui) {
    Response r = null;
    try {
       List products [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to figure out how to return a list in a response in JAXB.  The answer was <a href="http://n2.nabble.com/Jersey-JAX-RS-JAXB-Returning-an-Array-of-Objects-td2669077.html">here</a></p>
<p>Here&#8217;s a code snip</p>
<p><code><br />
  @GET<br />
  public Response getProducts(@QueryParam("active")String active,@QueryParam("family")String family,@Context UriInfo ui) {<br />
    Response r = null;<br />
    try {<br />
       List<Product> products = getProducts(active,family);<br />
       if (products.size() == 0) {<br />
         r = Response.status(404).build();<br />
      } else {<br />
         GenericEntity<List<Product>> genericProducts = new GenericEntity<List<Product>>(products) {};<br />
         r = Response.ok().entity(genericProducts).build();<br />
      }<br />
   } catch (Exception e) {<br />
     throwInternalServerError(e);<br />
   }<br />
   return r;<br />
 }<br />
</code></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Returning+List+in+JAXB+http://s27qh.th8.us" title="Post to Twitter"><img class="nothumb" src="http://blog.tmacsoft.com/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Returning+List+in+JAXB+http://s27qh.th8.us" title="Post to Twitter">Tweet This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.tmacsoft.com/java/returning-list-in-jaxb/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
