我不斷收到錯誤請求400時試圖發佈此陣列JSON的對象「對不起格式錯誤」:亨德爾JSON
{
"type":"input","uniqueId":434,"label":"name","viewToCall":"input-configuration-menu"},{"type":"button","uniqueId":930,"label":"name","viewToCall":"button-configuration-menu"}]
林不知道如何韓德爾不同類型的JSON對象在我@RequestBody:
@RequestMapping(value="/saveForm", method = RequestMethod.POST)
public @ResponseBody void saveForm(@RequestBody ArrayList<Components> text){
do somthing...
}
我發現這個resourcer但我沒有經驗讓它在網絡環境下工作: Spring @RequestBody containing a list of different types (but same interface) http://programmerbruce.blogspot.com.es/2011/05/deserialize-json-with-jackson-into.html http://aredko.blogspot.se/2012/04/json-for-polymorhic-java-object.html
您發佈的JSON擁有無可匹敵]在結束 – Mir
它只是錯過了當提問 –
您可能有問題的內容類型的標題,顯示您的請求的標題 – jpprade