Jackson List<Long>
은 다음 List<Integer>
과 같이 구문 분석 하므로 ClassCastException
. 해결책 중 하나는 매개 변수를 a로 취하는 List<String>
것이지만 저는 이것을하고 싶지 않습니다. 누군가 나에게 대안을 제안 할 수 있습니까?
@RequestMapping(value = "/device/deleteNote", produces = "application/json", method = RequestMethod.POST)
@ResponseBody
public ResponseEntity<?> deleteNotification(@RequestBody ArrayList<Long> notificationIdListParam) {
....
}
이 시도
final static ObjectMapper mapper = new ObjectMapper();
final List<Obj> instance = mapper.readValue(json, new TypeReference<List<Obj>>(){});
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다