ajax向后台传数组是可以直接传的,写法如下
var ids = [ ];
$(dom1).each(function(){
ids.push($(this).val());
});
var userId="123";
var url = path + "/xxx/ajaxAddUser.do?userId="+userId+"&ids="+ids;
$.ajax({
url:url,
type:"post",
success:function(data){
}
});
Controller中
public Object ajaxGetUser(String userId, String[ ] ids ){ }