【发布时间】:2014-07-09 11:37:29
【问题描述】:
我有一个 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;
}`
【问题讨论】:
标签: jquery ajax jqgrid http-status-code-406