代码:我试图将一个阵列的数据发送到SpingMVC我无法从Angularjs'post请求得到DATAS在js文件
todelSome: function (targetArr) {
var args = {"arr": targetArr};
var url = "toDelSome.req";
return $http({
method: 'POST',
data: args,
url: url
}).success(function (response, status, headers, config) {
return response;
console.log(response);
}).error(function (response, status, headers, config) {
alert(status + response);
});
}"
这里是我的代码用SpringMVC:
@ResponseBody
@RequestMapping("toDelSome")
public String toDelSome(@RequestParam("arr[]") Integer[] arr) {
System.out.println(arr);
return "";
}
我怎样才能从Angularjs'request数组数据?
不,这不是问题。我将其删除,问题仍然存在。 – JSO
是你想要'toDelSome'方法返回数组吗? –