1、js代码:

 

    var workData = [];
    // 添加元素
    workData.push({'pk':'1','name':'1x'});
    workData.push({'pk':'2','name':'2x'});
    workData.push({'pk':'3','name':'3x'});
    workData.push({'pk':'4','name':'4x'});
    
    $.post('/hospital1/entry/poActions.', 
    {
        mode:'saveWork',
        'workData':JSON.stringify(workData)
    });

 

2、java代码:

 

    List> list = gson.fromJson(request.getParameter("workData"), new TypeToken>>(){}.getType());
    for(Map map : list){
        System.out.print("pk:"+map.get("pk"));
        System.out.println("\tname"+map.get("name"));
    }