我有一个 jQuery ajax 调用:
$("tr." + trClassName).each(function() {
list1.push(some Id from td);
list2.push(some id from another td);
});
// 这里list1和list2就像 {1,2,3,4,...}
$.ajax({
type : "GET",
url : "./bulkUpdate" ,
data : "id=" + id + "&list1=" +list1+ "&list2=" + list2,
success : function(response) {
alert("Dispaly orders updated successfully");
},
error : function(e) {
alert('Error: ' + e);
}
});
现在在控制器中,我的接收器代码为:
@RequestMapping(value = "/bulkUpdate", method = RequestMethod.GET)
public @ResponseBody String updateOrders(@ModelAttribute(value = "content") Content content) {
// **Content** class has attributes for **list1** and **list2**
// here i am getting the correct data like:
List<String> list1= content.getList1();
List<String> list2= content.getList2();
/* do something */
return "success";
}
一切正常,但它总是返回
error : function(e) {
alert('Error: ' + e);
}
在火灾错误中,我收到以下错误:
*"NetworkError: 404 Not Found - http://localhost:8080/web-pack/tool/languageTool/bulkUpdate?id=1&list1=8,9,10,11,13,105,129,132,12,135,134&list2=8,9,10,11,14,15,16,17,18,19,20*