What steps will reproduce the problem?
1.Make a ajax call to a servlet and set the json object as below
Type listOfTestObject = new TypeToken< ArrayList <HashMap> >(){}.getType();
String sGson = new Gson().toJson(alReportsData,listOfTestObject);
response.getWriter().write(sGson);
2.how to read the json object in ajax success call
What is the expected output? What do you see instead?
Instead i receive a parse exception SyntxaxError:JSON.parse:unexpected
character
What version of the product are you using? On what operating system?
i am using google-gson-2.2.1 on Win XP
Please provide any additional information below.
$.ajax({
type: "POST",
url: "/app1/servlet/Controller?destinationHandler=208&obid= " + sObid ,
dataType: 'json',
success: function (data) {
console.log("Success... ");
??? How to deserialize the json object here ??? Please HELP !!
},
error: function(jqXHR, textStatus, errorThrown){
// I get an error here
alert(textStatus + " | " + errorThrown);
}
});
Thanks
Ranchs
Original issue reported on code.google.com by venkates...@gmail.com on 27 Jun 2012 at 7:28
Original issue reported on code.google.com by
venkates...@gmail.com
on 27 Jun 2012 at 7:28