我有一个 jqgrid 来填充来自后端的数据。直到控制器我有数据但它没有在网格中呈现。启用 Fire 错误说 NetworkError : 406 Not Acceptable。我的类路径和调度程序 aservlet 中有jackson-core-asl-1.x.jar和jackson-mapper-asl- 1.x.jar。我还尝试根据解决方案之一更改标题,例如 headers="Accept=application/json"。我正在使用 SPring4。以下是我在控制器中的代码。
`
@RequestMapping(value = "/populateAddedDeviceGrid.html", headers="Accept=application/json", method = RequestMethod.POST)
public @ResponseBody
GridPojo populateAddedDeviceGrid(HttpServletRequest request, GridPojo gridPojo) {
System.out.println("Enetering DeviceMasterController-->populateAddedDeviceGrid (POST)");
List<DeviceMaster> deviceMasterList = new ArrayList<DeviceMaster>();
try {
deviceMasterList = deviceMasterService.getAllDeviceMaster();
gridPojo.setGridData(deviceMasterList.toArray());
gridPojo.setRows(deviceMasterList.size());
gridPojo.setRecords(deviceMasterList.size());
} catch (Exception e) {
e.printStackTrace();
}
return gridPojo;
}`