SpringMVC返回Map类型转换成JSON失败
-
错误信息:WARN DefaultHandlerExceptionResolver:380 - Failed to write HTTP message: org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of type: class java.util.HashMap
-
解决办法:
导入依赖
<dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.4</version> </dependency>