JS:
ids:[4,5,6]
SERVLET:
//专用于传数单个字符串,返回值是字符串
String ids=request.getParameter("ids"); //["4"]
//专用于传数数组对象,返回值是字符串数组
String[] s=request.getParameterValues("ids"); //s:["4","5","6"]
//循环将字符串数组对象转换成数组
int[] a=new int[s.length];
for(int i=0;i<s.length;i++){
a[i]=Integer.parseInt(s[i]); //a:[4,5,6]
}