$.ajax函数调接口,报异常No converter found for return value of type: class java.util.ArrayList
接口正常执行,返回给前端后报服务器500异常,异常详情:
org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of type: class java.util.ArrayList
原因没有深究,大概是$.ajax函数在前端接收的数据类型为JSON,而服务中没有能将ArrayList转换成JSON的类。
暂时记下解决方案——在项目中添加JSON全家桶的依赖如下:
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.9</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.9</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.9</version>
</dependency>
随机推荐
- issue - 登录前的信息和标识文件
DESCRIPTION (描述) /etc/issue 是一个文本文件,它包含了在登录提示符出现之前显示的信息或者系统标识.如果 getty(1) 支持的话,它可能包括多个 @char 和 \char ...
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install (default-cli) on project kircp-js-plan-resource: The packaging for this project did not assign a file to the bu
结合网上的相关资料,要使用Lifecycle下的install 原因好像是Lifecycle下才会走Maven完整的phase.
- [转]为什么要引入nullptr?
来源:https://cloud.tencent.com/developer/ask/69685 C++11介绍nullptr,它被称为Null指针常数及其提高类型安全性和解决不明确的情况与现有实现相 ...
- Kendo UI for jQuery使用教程:入门指南
[Kendo UI for jQuery最新试用版下载] Kendo UI目前最新提供Kendo UI for jQuery.Kendo UI for Angular.Kendo UI Support ...
- WebSoket的简单用法
第一步,在客户端配置 <script> var websocket; if ('WebSocket' in window) { websocket = new WebSocket('ws: ...
- python绘制国际象棋棋盘核心代码
import turtle step = 40 for i in range(8): for j in range(8): turtle.penup() turtle.goto(i*step, j*s ...
- axios获取响应头
[转载] 来源:https://segmentfault.com/a/1190000009125333 在用 axios 获取 respose headers 时候获取到的只有的 Object { c ...
- jQuery后续和 前端框架Bootstrap
目录 一.jQuery后续 1. 动画效果 (1)自定义点赞动画实例 2. jQuery的自带方法 (1)each (类似for循环) (2)data() (存放隐形的数据) 二.前端框架之Boots ...
- thinkphp一对多关系
兹有用户表user和评论表comment 一对一 public function returnmany() { return $this->hasOne('commnet','uid','use ...
- MongoDB学习笔记 1.1
//1.安装MongoDB数据库 cd D:\Software\MongoDB\data\bin mongod --dbpath "D:\Software\MongoDB\data\db&q ...