如何在jquery中检索使用Gson生成的json对象数据,在.jspf文件中对Js数组进行ajax调用
我有一个ArrayList,其中包含Hashmap对象作为行详细信息,其中每个Hashmap都是放置在ArrayList中的行如何在jquery中检索使用Gson生成的json对象数据,在.jspf文件中对Js数组进行ajax调用,jquery,gson,Jquery,Gson,我有一个ArrayList,其中包含Hashmap对象作为行详细信息,其中每个Hashmap都是放置在ArrayList中的行 ArrayList <HashMap> alData = new ArrayList <HashMap> (); 谢谢 Type listOfObject = new TypeToken< ArrayList <HashMap> >(){}.getType(); String sGson = new Gson().toJ
ArrayList <HashMap> alData = new ArrayList <HashMap> ();
谢谢
Type listOfObject = new TypeToken< ArrayList <HashMap> >(){}.getType();
String sGson = new Gson().toJson(alData,listOfObject);
$.ajax({ type: "POST",
url: "/app1/servlet/Controller?handler=28&obid= " + sbId ,
data: "namedQuery=reports&queryParam=" + sbId, success: function (data)
{
Please help me retrieve the data from the
Gson object to convert to an Javascript array.
},
error: function(jqXHR, textStatus, errorThrown){
alert(textStatus + " | " + errorThrown);
},
dataType: 'json'
});