title: Deserialize ArrayList from String using Jackson
body: <p>I am using Spring's MappingJacksonHttpMessageConverter to convert JSON message to object in my controller.  </p>
  
  <pre><code>&lt;bean id="jsonConverter"
      class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"&gt;
      &lt;property name="prefixJson" value="false" /&gt;
      &lt;property name="supportedMediaTypes" value="application/json" /&gt;
  &lt;/bean&gt;
  
  &lt;bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"&gt;
      &lt;property name="messageConverters"&gt;
          &lt;list&gt;
              &lt;ref bean="jsonConverter" /&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>For fields that are declared as ArrayList, if the json message contains a String instead, the following exception will be thrown:</p>
  
  <pre><code>org.springframework.http.converter.HttpMessageNotReadableException: 
   Could not read JSON: Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token
  </code></pre>
  
  <p>An example would be the class definition below:</p>
  
  <pre><code>public class Product {
     private String name;
     private List&lt;String&gt; images;
  }
  </code></pre>
  
  <p>Where the incoming Json is:</p>
  
  <pre><code>{name:"Widget", images:"image1.jpg"}
  </code></pre>
  
  <p>AS you can see, this will produce the exception since image is expected to be an array.</p>
  
  <p>I would like to make custom deserializer which is a bit more tolerant.  If deserialization fails, create a ArrayList of a single element from the String.  How would I go about injecting this into the MappingJacksonHttpMessageConverter or ObjectMapper?</p>
  
  <p>I am not looking to use annotation to mark each and every ArrayList field so a custom deserialize could be used.  <strong>I am looking for a way to overwrite the default deserializer to preform this function.</strong></p>