I hope to receive a list in my controller that is sent by ajax , in Java but I get an error:
Non-type collection, that is, it does not match.
Any other way to stop it?
JavaScript
var itms = [];
for (i = 1; i < 10; i++) {
var obj = {};
obj['cantidadD'] = i;
obj['unidadD'] = 'kg';
itms.push(obj);
}
$.ajax({
url: 'genimp',
type: 'GET',
data: {itm: itms},
success: function (r) {
}
});
Driver
//public @ResponseBody Map<String, Object> genfacturaimp(List itm){
public @ResponseBody Map<String, Object> genfacturaimp(ArrayList itm){
Map<String, Object> map = new HashMap();
map.put("fn", itm.size());
map.put("l", 1);
return map;
}