欢迎您关注微|信|公|众|号:学习微站
qrcode_for_gh_cfaee56a6152_258 (2).jpg

自定义分页功能明显太过繁琐了
—》我们使用pageHelper插件来快速实现分页功能 1、在pom.xml文件中引入依赖库


 
 `com.github.pagehelper`
 `pagehelper`
 `5.1.10`
 

2、在spring-mybatis添加分页配置

3、Controller添加

欢迎您关注微|信|公|众|号:学习微站
qrcode_for_gh_cfaee56a6152_258 (2).jpg

 `@RequestMapping(value = "/getUserPage")`
 `public String getUserPage(Page page, Model model){`
 `PageInfouserPageInfo = userService.selectPage(page);`
 `model.addAttribute("pageInfo",userPageInfo);`
 `model.addAttribute("url","user/getUserPage");`
 `return  "user/userList";`
 `}`

`
欢迎您关注微|信|公|众|号:学习微站
![qrcode_for_gh_cfaee56a6152_258 \(2\).jpg](/img/bVcKQkl)


上面是针对SSM场景来做的,pagehelper插件本身就是基于Mybatis这种框架进行开发的插件。所以,主要都是针对Mybatis数据操作的架构的。方法不止这一种

学习微站公众号
4 声望0 粉丝