springmvc @ResponseBody日期格式化

[code="java"]
@Component
public class JsonDateSerializer extends JsonSerializer {

private static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");

@Override
public void serialize(Date date, JsonGenerator gen, SerializerProvider arg2)
        throws IOException, JsonProcessingException {
    String formattedDate = format.format(date); 
    gen.writeString(formattedDate); 
}

}

@JsonSerialize(using=JsonDateSerializer.class)
public Date getCreateDate() {
return createDate;
}
[/code]

http://blog.csdn.net/rendiyi/article/details/8056514
这个文章是介绍返回类型是实体类的 比如返回List
然后再 属性上加标记 using=JsonDateSerializer.class可以正确返回

但是我的Controller里返回的是Map 这里面有个Date类型
返回到客服端就不起作用了。如果解决(我不想把Map里的日期取出来手动的去转 那样要累死的)