问题描述
条件查询并且分页显示,pageIndex页码可以接收到,但是用实体类(Appinfo)接收条件并没有接收到,很不解,求帮助!
相关代码
前端ajax代码:
function pageHandler(pageIndex) {
console.log(">>>>>>>>> pageIndex:"+pageIndex)
var data = $("form").serialize()
console.log(data)
$.ajax({
url:"./paging2",
type:"post",
data:{
pageIndex:pageIndex,
appInfo:$("form").serialize()
},
success : function (result) {
console.log(result)
console.log(pageIndex)
pageIndex = result.pageIndex;
build_app_tab(result)
build_page_prompt(result)
}
})
}
Controller代码:
@RequestMapping("paging2")
@ResponseBody
public Page<AppInfo> paging2(@RequestParam(value = "pageIndex",defaultValue = "1") Integer pageIndex, AppInfo appInfo){
return appService.getAppInfoByService(appInfo,pageIndex);
}
调试截图:
不是接收不到提交的数据,是不能这么智能地给你序列化到这个实体上。你用String 接收试试。