Spring MVC:报错No converter found for return value of type
来源:互联网 发布:赛酷ocr软件 编辑:程序博客网 时间:2024/06/05 03:14
问题描述:
请求数据返回时报错No converter found for return value of type
原因:
不能将map转换为json传输
解决方案:
引入json相关包:
<dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-core-asl</artifactId> <version>1.9.10</version></dependency><dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version>1.9.10</version></dependency><dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>2.2.3</version></dependency><dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.2.3</version></dependency><dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.2.3</version></dependency><dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.2.3</version> <classifier>jdk15</classifier></dependency>
修改applicationContext.xml文件:
<bean id="mappingJackson2HttpMessageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"> <property name="supportedMediaTypes"> <list> <value>text/html;charset=UTF-8</value> <value>application/json;charset=UTF-8</value> </list> </property></bean>
为响应返回类添加setter方法
阅读全文
0 0
- Spring MVC:报错No converter found for return value of type
- Spring MVC No converter found for return value of type 解决方法
- Spring MVC No converter found for return value of type 解决方法
- 解决 Spring MVC No converter found for return value of type
- springmvc框架报错java.lang.IllegalArgumentException: No converter found for return value of type: class
- SpringMVC 返回json数据报错IllegalArgumentException: No converter found for return value of type:xxx
- No converter found for return value of type解决方法
- springboot访问方法时出错:Spring Boot Application: No converter found for return value of type
- spring boot:No converter found for return value of type: class另类解决办法
- 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
- 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.lang.IllegalArgumentException: No converter found for return value of type: class
- HttpMessageConverter配置javaconfig(未配置异常:No converter found for return value of type)
- json转换错误:No converter found for return value of type
- 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
- 百度js面试题
- Python笔记(持续更新)
- KALI-RTL8811AU
- 查看 OSD 版本
- fork后父子进程共享资源
- Spring MVC:报错No converter found for return value of type
- java网络编程之Socket
- RecyclerView的适配器
- phpStudy for Linux (lnmp+lamp一键安装包)
- 7.30学习总结
- BSS段、数据段、代码段、堆与栈
- nessus集成hydra进行弱口令暴力破解
- @SpringBootApplication的使用
- Eclipse Che安装体验(一)----Windows下docker的安装