Retrieve the data sent as JSON from JavaScript, inside a servlet
问题 I have a query on retrieving data sent as JSON from a JavaScript, inside a Java servlet. Following is what I am doing... This is the part of the code inside JavaScript making a request to a servlet type : "POST", url: 'getInitialData', datatype: 'json', data : ({items :[{ name: "John", time: "2pm" },{name: "Sam", time: "1pm" }]}), success: function(data) { try{ ////Code to be handeled where response is recieved }catch(e){ alert(e); } } On making this request I try to retrieve the parameters