mybatis pagehelper插件实现后端分页

pagehelper分页实现

前段部分:

通过JS实现

Controller:

@RequestMapping("/find.do")
public ModelAndView find(@RequestParam(value="pn",defaultValue="1")Integer pn, @RequestParam(value = "PageSize", defaultValue = "8") Integer ps,String test) throws Exception {
    PageHelper.startPage(pn,ps);
    List obj = iTestService.find(test);
    PageInfo page = new PageInfo(foc_express_h,ps);
    System.out.println(page);
    ModelAndView mv = new ModelAndView();
    mv.setViewName("test");
    mv.addObject("pageInfo", page);
    mv.addObject("obj",obj );
    return mv;
}

 

你可能感兴趣的:(mybatis pagehelper插件实现后端分页)