title: Don't return property when it's an empty list with jackson
body: <p>I have a class need to be dessrialized using jackson and the class has an collection property. The collection is empty, but not null. 
  Question: How to desersialise the class <b>without</b> empty collection. Sample code below:</p>
  
  <pre><code>class Person
  {
      String name;
      List&lt;Event&gt; events;
      //....getter, setter
  }
  </code></pre>
  
  <p>if </p>
  
  <pre><code>person.list = new List&lt;Event&gt;(); 
  persion.name = "hello";
  </code></pre>
  
  <p>then excepted the json would be:</p>
  
  <pre><code>{name: "hello"}
  </code></pre>
  
  <p>not </p>
  
  <pre><code>{name: "hello", events:[]}
  </code></pre>
  
  <p>How to make it? Thank you~~</p>
  
  <p>================================================</p>
  
  <p>I have solved this by n1ckolas's advice. Thank you first.
  My jackson version is 2.1.1, and Spring-3.2.2 import better support for this verson of jackson. Also, this works for both <B> arrays and collection.</B>
  Below is my configuraion:</p>
  
  <pre><code>&lt;!-- Enables the Spring MVC @Controller programming model --&gt;
  &lt;mvc:annotation-driven&gt;
      &lt;mvc:message-converters&gt;
          &lt;bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"&gt;
              &lt;property name="objectMapper" ref="objectMapper"/&gt;
          &lt;/bean&gt;
      &lt;/mvc:message-converters&gt;        
  &lt;/mvc:annotation-driven&gt;
  
  &lt;!--Json Mapper--&gt;
  &lt;bean name="objectMapper" class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean" autowire="no"&gt;
      &lt;property name="featuresToDisable"&gt;
          &lt;list&gt;
              &lt;!--not to return empty colletion--&gt;
              &lt;value type="com.fasterxml.jackson.databind.SerializationFeature"&gt;WRITE_EMPTY_JSON_ARRAYS&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>