Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在jquery中检索使用Gson生成的json对象数据,在.jspf文件中对Js数组进行ajax调用_Jquery_Gson - Fatal编程技术网

如何在jquery中检索使用Gson生成的json对象数据,在.jspf文件中对Js数组进行ajax调用

如何在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对象作为行详细信息,其中每个Hashmap都是放置在ArrayList中的行

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' 
});