整理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/>
本文解决了一个SSM项目中出现的HttpMessageNotWritableException异常,该异常导致后台数据无法传到前台。通过更新Jackson版本及启用springmvc的mvc:annotation-driven配置,成功解决了问题。
1041

被折叠的 条评论
为什么被折叠?



