整理ssm项目的时候遇到了一个传参的bug
Failed to write HTTP messageorg.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of type: Class com.xxx.xxx.pojo.xxx
后台获取到的数据没有传到前台,检查后得到解决
解决方法:
jackson版本问题,替换成以下版本
<!--json-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.10</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.10</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.10</version>
</dependency>
并且将springmvc中的mvc:annotation-driven开启
<mvc:annotation-driven/>