title: Jersey JSON marshalling of empty lists
body: <p>We have a Java List of objects which is marshalled via JSON which is created by Jersey.</p>
  
  <p>The List is called "rows".  When there is data we have:</p>
  
  <pre><code>{"records":"1","page":"1","total":"1","rows":[{"id":"692334","cell":["ECS","D","201009","","0","ABCD","11","11","","201009"]}]}
  </code></pre>
  
  <p>When there is no data we have: </p>
  
  <pre><code>{"page":0,"records":0,"total":0}
  </code></pre>
  
  <p>How can we make Jersey include the <code>rows</code> field even if the List has a size of 0?  What we want is:</p>
  
  <pre><code>{"page":0,"records":0,"total":0,"rows":[]}
  </code></pre>
  
  <p>Note that we are already using a JAXB ContextResolver to <a href="http://blogs.oracle.com/japod/entry/configuring_json_for_restful_web" rel="nofollow">ensure</a> the JSON is correct for a single row.  Not sure if we can configure this resolver to solve our problem.</p>