I have a JSON format of
var array1 = new Array; var array2 = new Array; //push some string to array1 and array2 var data = JSON.stringify({'email':email,'age':age,'array1':array1,'array2':array2});
How could I map it to POJOs using Jackson JSON Mapper to avoid 400 Bad Request.
I have tried
public class MyPOJOs{ private String email; private String age; private MyList array1; private MyList array2; //getters and setters } public class MyList{ private ArrayList list; //getter and setter }
My controller
public @ResponseBody Response myController(@RequestBody MyPOJOs myPOJOs){ String email = myPOJOs.getEmail(); logger.log("Hi " + email); return null; }
Thanks.
data
to your question. Also, how does it not work? Are there any exceptions? If so add them to your question in full. – Philipp Reichart