springMVC返回json格式数据报错:No converter found for return value of type: class java.util.HashMap
来源:互联网 发布:avmo.pw最新域名 编辑:程序博客网 时间:2024/06/07 14:35
博主刚在写上一篇文章: SpringMVC异步上传多文件 的时候返回json格式对象,一直报错:
No converter found for return value of type: class java.util.HashMap at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:187) at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:174) at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:81) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:132) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
总结:在springmvc中,如果使用@ResponseBody 返回json格式对象,需要导入jackson的jar包。
<dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.8.8</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>2.8.8</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.8.8</version> </dependency>
阅读全文
1 0
- springMVC返回json格式数据报错:No converter found for return value of type: class java.util.HashMap
- springMVC返回json格式数据报错:No converter found for return value of type: class java.util.HashMap
- SpringMVC 返回json数据报错IllegalArgumentException: No converter found for return value of type:xxx
- springmvc框架报错java.lang.IllegalArgumentException: No converter found for return value of type: class
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- 解决java.lang.IllegalArgumentException: No converter found for return value of type: class java.util
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util
- 解决java.lang.IllegalArgumentException: No converter found for return value of type: class java.util
- 【已解决】java.lang.IllegalArgumentException: No converter found for return value of type: class java.uti
- java.lang.IllegalArgumentException: No converter found for return value of type: class
- 记录下报错:java.lang.IllegalArgumentException: No converter found for return value of type: class
- java.lang.IllegalArgumentException: No converter found for return value of type:class 解决方案
- 关于java.lang.IllegalArgumentException: No converter found for return value of type: class 的问题解决
- Spring MVC:报错No converter found for return value of type
- No converter found for return value of type解决方法
- No converter found for return value of type: class com.alibaba.fastjson.JSONObject MappingJackson2Ht
- spring boot:No converter found for return value of type: class另类解决办法
- Android studio 3.0 引起的 outputFile sync failed:not vaild
- kotlin和DataBinding一起使用踩坑日记
- G2.9 std_alloc
- solr erro no term info available
- preparedStatement和statement,CallableStatemen的区别与联系
- springMVC返回json格式数据报错:No converter found for return value of type: class java.util.HashMap
- Java 利用 DES / 3DES / AES 三种算法分别实现 对称加密
- 指针
- vue-awesome打包报错
- 复杂网络MATLAB工具箱
- python解析xml
- 直接在屏幕上,选取区域进行截屏分享到QQ、微信
- WebView踩坑(一),load()加载数据出现乱码
- Java学习笔记-《Java程序员面试宝典》-第四章基础知识-4.1基本概念(4.1.8-4.1.9)