http://my.oschina.net/u/202293/blog/375578 html
http://blog.csdn.net/edward9145/article/details/18700415 java
http://www.micmiu.com/j2ee/spring/springmvc-jsonserialize-date/ spring
http://java.dzone.com/articles/how-serialize-javautildate 數據庫
http://www.blogjava.net/crazycy/archive/2014/07/15/415839.html json
其實在返回實體類的時候,這樣是可行的,可是爲了方便簡化起見,直接將數據庫內的內容以Map形式返回,更簡便mvc
因此只要斷定一下返回的類型是不是TimeStamp,將TimeStamp,toString()一下,這個問題就解決了...困擾了我很久.net
這也說明一個問題,要找到問題的根源,這個問題就容易解決了.code
/** * 爲了不 : java.util.ConcurrentModificationException * * @param map * @return */ @SuppressWarnings({ "rawtypes", "unchecked" }) public static Map<String, Object> Convert2LowerCase(Map<String, Object> map) { HashMap<String, Object> map1 = new HashMap<String, Object>(); Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); String key = ((String) entry.getKey()).toLowerCase(); Object value = null; if(entry.getValue() instanceof Timestamp) value = entry.getValue().toString(); else value = entry.getValue(); map1.put(key, value); } return map1; }