title: Jodatime/Spring MVC/Jackson | DateTime formatting issue
body: <p>When I use the @ResponseData JodaTime is converted into it's full object state, even though I have a custom serializer in place. </p>
  
  <p><strong>Configuration:</strong></p>
  
  <p>Spring 3.1.2
  Jackson 1.9.11</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-core-asl&lt;/artifactId&gt;
      &lt;version&gt;${jackson.version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
      &lt;version&gt;${jackson.version}&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Custom Serializer:</p>
  
  <pre><code>public class JodaDateTimeJsonSerializer extends JsonSerializer&lt;DateTime&gt; {
  
      //TODO Bad (hard) code. This should be part of a global system setting through ConfigurationService
      private static final String dateFormat = ("dd/MM/yyyy");
  
      private static Logger logger = LoggerFactory.getLogger(JodaDateTimeJsonSerializer.class);
  
      @Override
      public void serialize(DateTime date, JsonGenerator gen, SerializerProvider provider)
              throws IOException, JsonProcessingException {
  
          String formattedDate = DateTimeFormat.forPattern(dateFormat).print(date);
          logger.debug("Converted date string: {}", formattedDate);
          gen.writeString(formattedDate);
      }
  }
  </code></pre>
  
  <p>Dispatcher:</p>
  
  <pre><code> &lt;mvc:annotation-driven /&gt;   
  </code></pre>
  
  <p>Usage:</p>
  
  <pre><code>@JsonSerialize(using=JodaDateTimeJsonSerializer.class)
      public DateTime getExpiryDate() {
          return expiryDate;
      }
  </code></pre>
  
  <p>The output I'm getting is similar to this:</p>
  
  <pre><code>"dateCreated":{"monthOfYear":12,"yearOfEra":2012,"yearOfCentury":12,"centuryOfEra":20,"millisOfSecond":359,"millisOfDay":53080359,"secondOfMinute":40,"secondOfDay":53080,"minuteOfHour":44,"minuteOfDay":884,"hourOfDay":14,"weekyear":2012,"weekOfWeekyear":51,"year":2012,"dayOfMonth":19,"dayOfWeek":3,"era":1,"dayOfYear":354,"chronology":{"zone":{"fixed":false,"cachable":false,"id":"Asia/Riyadh"}},"millis":1355917480359,"zone":{"fixed":false,"cachable":false,"id":"Asia/Riyadh"},"afterNow":false,"beforeNow":true,"equalNow":false},"dateModified":{"monthOfYear":12,"yearOfEra":2012,"yearOfCentury":12,"centuryOfEra":20,"millisOfSecond":359,"millisOfDay":53080359,"secondOfMinute":40,"secondOfDa
  </code></pre>
  
  <p>Where I want a simple dd/mm/yyyy date.</p>
  
  <p>Please advice.</p>
  
  <p>Additionally, how can I set this formatting rule globally where I don't have to use @JsonSerialize all the time.</p>