解决No converter found for return value of type: class java.util.ArrayList
程序员文章站
2024-01-14 13:19:04
...
问题描述
出现 No converter found for return value of type: class java.util.ArrayList 这种错误
1.原因:这是因为springmvc默认是没有对象转换成json的转换器的,需要手动添加jackson依赖。
2.解决步骤:
手动添加jackson依赖到pom.xml文件中
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.11.0</version>
</dependency>
添加完依赖之后,记得在project structure中的lib中也添加相关依赖!
推荐阅读
-
整合SSM之springmvc 报错:No converter found for return value of type: class java.util.ArrayList
-
解决No converter found for return value of type: class java.util.ArrayList
-
No converter found for return value of type: class java.util.ArrayList
-
No converter found for return value of type: class java.util.ArrayList
-
No converter found for return value of type: class XXX
-
【Spring】No converter found for return value of type: class java.util.ArrayList
-
关于No converter found for return value of type: class java.util.ArrayList
-
HTTP Status 500 - No converter found for return value of type: class java.util.ArrayList
-
SpringMVC 报错HTTP Status 500 - No converter found for return value of type解决方案
-
springboot报错_No converter found for return value of type原因是没有这个对象的json转换器