Spring @RequestBody override date
<p>I'm trying to get the requestBody to automatically map to an class, but i'm having issues with the object being rejected because of the date</p>

<p>Spring Version 4.1 - It appears that spring is using gson instead of jackson</p>

<p>Could you please help with the following </p>

<ol>
<li>How do i specify which parser spring uses for the mapping?</li>
<li>How do i override the settings to that parser using either annotation xml?</li>
<li>is there any other information that would be helpful?</li>
</ol>

<p>I've tried some thing like this but they dont seem to work </p>

<pre><code>@Type(type="timestamp")
//@JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm a z")
//@JsonDeserialize(using = DateDeserializer.class)
//@JsonSerialize(using = CustomDateSerializer.class)
@Column(name = "date")
private Date date;
</code></pre>

<p>I've also tried manually setting a gson parser to user a specific date format which worked but i cant seem to figure out how to ovveride the one that spring is using</p>

<pre><code> gsonBuilder.setDateFormat("MM-dd-yyyy");

"org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: 05/17/2016; nested exception is com.google.gson.JsonSyntaxException: 05/17/2016"

@RequestMapping(value = "/saveIdea", method = RequestMethod.POST)
public @ResponseBody ResponseEntity saveIdea(@RequestBody Idea idea) throws IOException {}
</code></pre>

<p>Heres one way i tried to override it, it doesnt seem to be using this </p>

<pre><code>@EnableWebMvc
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {

    @Override
    public void configureMessageConverters(List&lt;HttpMessageConverter&lt;?&gt;&gt; converters) {
        //converters.add(new ExtendedGsonHttpMessageConverter());
        GsonHttpMessageConverter msgConverter = new GsonHttpMessageConverter();
        Gson gson = new GsonBuilder().setPrettyPrinting().create(); 

        msgConverter.setGson(gson);
        converters.add(msgConverter);
    }
}
</code></pre>