컨트롤러가 Google 프런트 엔드에서 오는 Google Guava Multimap
을 매핑 할 수 없습니다. 나는 표준봄 MVC 매핑 Guava Multimap
java.util.Map<Long, List<Boolean>>
모든 것이 잘 작동 사용하는 경우
{1:[true,false], 2:[false,true], ...}.
: 내 자바 스크립트에서이 객체를 보낼 수 있습니다. 그러나 구아바가 아닌 Multimap
. 일부 사용자 정의 변환기를 사용하도록 Spring을 구성해야합니까, 아니면 무엇이 문제입니까?
컨트롤러는 다음과 같습니다
@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: [email protected]; 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
자세한 내용을 알려주십시오 : 코드 (컨트롤러, 변환기)와 예외 사항을 알려주십시오. – Xaerxess