Type definition error: [simple type, class net.sf.json.JSONString]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of net.sf.json.JSONString
(no Creators, like default construct, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information at [Source: (PushbackInputStream); line: 7, column: 21]
翻譯爲以下:
類型定義錯誤:【簡單類型,class net.sf.json.jsonString】;嵌套異常爲com.fasterxml.jackson.databind.exc.invalidDefinitionException:無法構造’net.sf.json.jsonString’的實例(不存在創建者,如默認構造):抽象類型要麼需要映射到concrete類型,具有自定義反序列化程序,或在[源:(pushbackinputstream);行:7,列:21]處包含其他類型信息
這是前端傳的數據(POSTMAN)測試的:
注意問題在:
detailedList
後臺接收用的
private JSONString detailedList;
這裏主要是前端傳一條數據,數據裏包含多條數據
(操作一個表格插入一條數據和另外關聯表插入多條數據)
這裏的問題主要在於 傳入和接收的類型不一致 不能序列化成功
把detailedList 類型直接改成String類型 就可以接收到了,繼而用JSONArray轉一下,就可以操作數據了