springmvc4.0以上和jackson版本问题

在整合springmvc时,要返回json格式的数据出现问题,特地记录下供以后查看。

先看下错误:

org.springframework.web.util.NestedServletException:Handler dispatch failed; nested exception is java.lang.NoSuchMethodError

一般都是通过 @ResponseBody 返回json数据的。还采用jackson与springmvc的配置话,需要选择合适的版本。jackson2.7不兼容最新的springmvc4.2.4官网描述:

Work on Jackson 2.7 started in August 2015

 and completed in early January 2016.

 We need to revise our type variable exposure (SPR-13728for proper Jackson 2.7 support in Spring Framework 4.3 

and should also evaluate other changes that are worth adapting to. 

所以要想执行成功需要选择jackson2.6版本才能和springmvc4.3.0正确使用。


另外再说下:mybatis-3.2.8和mybatis-3.4.1差别,对于datetime类型的数据在进行大小比较时mybatis-3.4.1版本不需要进行空字符串判断。

猜你喜欢

转载自blog.csdn.net/witewater/article/details/54138582