Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring mvc Spring MVC映射Guava多重映射_Spring Mvc_Mapping_Guava_Multimap - Fatal编程技术网

Spring mvc Spring MVC映射Guava多重映射

Spring mvc Spring MVC映射Guava多重映射,spring-mvc,mapping,guava,multimap,Spring Mvc,Mapping,Guava,Multimap,我的控制器无法映射来自前端的Google GuavaMultimap。我从Javascript发送此对象: {1:[true,false], 2:[false,true], ...}. 如果我使用标准 java.util.Map<Long, List<Boolean>> 我的例外是: 是吗?默认情况下,Jackson(以及Spring)不支持序列化或反序列化到Guava数据类型 Guava模块可能适用于您,也可能不适用于您,这取决于您想要的Multimap的实现—

我的控制器无法映射来自前端的Google Guava
Multimap
。我从Javascript发送此对象:

{1:[true,false], 2:[false,true], ...}. 
如果我使用标准

java.util.Map<Long, List<Boolean>> 
我的例外是:

是吗?默认情况下,Jackson(以及Spring)不支持序列化或反序列化到Guava数据类型

Guava模块可能适用于您,也可能不适用于您,这取决于您想要的
Multimap
的实现——并不是所有的数据类型都实现了。

是吗?默认情况下,Jackson(以及Spring)不支持序列化或反序列化到Guava数据类型


Guava模块可能适用于您,也可能不适用于您,这取决于您想要的
Multimap
的实现方式——并不是所有的数据类型都实现了。

请更具体一些:向我们显示您的代码(控制器、转换器)和异常。请更具体一些:向我们显示您的代码(控制器、转换器)和异常。啊,我想这就是原因。我的pom中没有该模块。我原以为它会开箱即用:-)谢谢。啊,我想这就是原因。我的pom中没有该模块。我原以为这是开箱即用的:-)谢谢。
@RequestMapping(path = "/myurl", method = RequestMethod.POST, produces = CotrollerKonstanten.JSON_UTF8)
public long myMethod(@RequestBody MappingDto mappingDto) {
  //...
}
org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: 
  Can not construct instance of com.google.common.collect.Multimap, problem:
  abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information
at [Source: java.io.PushbackInputStream@4b9c2db; line: 1, column: 13] (through reference chain: ...myClass); 
nested exception is com.fasterxml.jackson.databind.JsonMappingException: 
  Can not construct instance of com.google.common.collect.Multimap, problem: abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information