首页 新闻 赞助 找找看

eclipse中分页问题 springmvc+springdate jsp +hibernate+spring

0
悬赏园豆:10 [已解决问题] 解决于 2018-04-18 10:57

这是后台控制层的分页代码

@RequestMapping("/findcustomer")//实现分页查询
@ResponseBody
public MyAjaxResult findCustomer(Integer adminId,String search,Integer currentPage,Integer pageSize){

PageModel pageModel;
try {
pageModel = cusService.findList(adminId,search,currentPage,pageSize);

return MyAjaxResult.success(pageModel);
} catch (Exception e) {

e.printStackTrace();
return MyAjaxResult.fail_300("查询失败");
}
}

怎样在JSP页面这段代码实现分页查询

getCustomerListAjax();//模糊查询和查看全部
function getCustomerListAjax(cur) {
$.ajax({
url:"${pageContext.request.contextPath}/loginAction/get_customerList",
type:"post",
data:$("#seachForm").serialize(),
dataType:"json",
success: function(data){
if(data.code==200){
console.log(data);

$('#courseTypeWrap').html(template('courseTypeTest', data));
}else{
layer.open({
title: '警告!',
content: data.msg
,yes: function(index, layero){
//按钮【按钮一】的回调
window.location.href="${pageContext.request.contextPath}/loginAction/login"
}
});
}
}
});
}

不点江山的主页 不点江山 | 初学一级 | 园豆:200
提问于:2018-04-17 09:37
< >
分享
最佳答案
0

是哪一部分不会,前端写隐藏input存页数,传到后端根据每页数据数量算出第a条数据到第几b条数据,sql中limit a,b

收获园豆:10
小光 | 小虾三级 |园豆:1766 | 2018-04-17 10:36
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册