jsp前端

var array = new Array();
array.push(0);
array.push(1);
array.push(2);
array.push(3);

function mydo(){
    $.post("del.do",{data:array.toString},function(result){
        alert(result);
    })
}

後端
此處用的是SpringMVC

@RequestMapping(value="/del.do",produces={"text/html;charset=UTF-8"})
    @ResponseBody
    public int toDel(Long[] data) {
            for (Long long1 : data) {
                System.out.println(long1);
            }
        return "sucess";

    }

控制檯輸出的是 0 1 2 3