The problem is not @ModelAttribute
, it just means what data that you want to store or get from model. It seems that you use jQuery datatables, so you should add @ResponseBody
to the method agents()
.
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public DTResponse agents() {
DTResponse resp = new DTResponse();
resp.setsEcho(1);
resp.setiTotalDisplayRecords(10);
resp.setiTotalRecords(50);
return resp;
}
}