spring+mybatis返回json日期处理(日期全局处理相差8个小时解决方法)
2016-08-12 17:08
357 查看
<mvc:annotation-driven> <mvc:message-converters> <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"> <property name="objectMapper"> <bean class="com.fasterxml.jackson.databind.ObjectMapper"> <!-- 处理responseBody 里面日期类型 --> <property name="dateFormat"> <bean class="java.text.SimpleDateFormat"> <constructor-arg type="java.lang.String" value="yyyy-MM-dd HH:mm:ss" /> </bean> </property> <!-- 时区指定 --> <property name="timeZone" value="GMT+8" /> <!-- 为null字段时不显示 --> <property name="serializationInclusion"> <value type="com.fasterxml.jackson.annotation.JsonInclude.Include">NON_NULL</value> </property> </bean> </property> </bean> </mvc:message-converters> </mvc:annotation-driven>
相关文章推荐
- spring+mybatis返回json日期处理(日期全局处理相差8个小时解决方法)
- spring+mybatis返回json日期处理(日期全局处理相差8个小时解决方法)
- spring+mybatis返回json日期处理(日期全局处理相差8个小时解决方法)
- spring+mybatis 通过@ResponseBody返回结果中文乱码的解决方法
- SpringMVC+MyBatis 返回的json日期为Long的解决方案
- springMVC中返回json时,日期类型自动转换为long类型的时间戳的处理方案(一个配置解决)
- SpringMVC + Spring + MyBatis 学习笔记:提交数据遭遇基础类型和日期类型报400错误解决方法
- Spring Boot @ControllerAdvice 处理全局异常,返回固定格式Json
- SpringBoot学习之全局异常处理设置(返回JSON)
- SpringMVC+MyBatis - 12 spring mvc4返回的json日期为Long的解决方案
- Spring Boot @ControllerAdvice 处理全局异常,返回固定格式Json
- SpringMVC+MyBatis - 12 spring mvc4返回的json日期为Long的解决方案
- springmvc+mybatis xml中SUM()方法返回NULL的解决办法
- SpringMVC + Spring + MyBatis 学习笔记:提交数据遭遇基础类型和日期类型报400错误解决方法
- (已解决)如何让Spring MVC Controller的同一个方法,根据逻辑判断返回JSON或者HTML视图?
- PHP处理Json字符串解码返回NULL的解决方法
- 将string直接返回网页,不能作为json处理的解决方法
- SpringMVC + Spring + MyBatis 学习笔记:提交数据遭遇基础类型和日期类型报400错误解决方法
- Spring返回json乱码解决方法
- SpringBoot学习——全局异常处理设置(返回JSON)