zl程序教程

您现在的位置是:首页 >  其他

当前栏目

PageHelper使用步骤

2023-03-20 14:49:03 时间

一、导入jar包(maven构建导入坐标)

<dependency>
        <groupId>com.github.pagehelper</groupId>
        <artifactId>pagehelper</artifactId>
        <version>5.1.2</version>
</dependency>

二、将PageHelper交给IOC管理

 

 三、Controller中获取浏览器传递页码page和每页显示数size

 

 四、在Service中调用dao查询方法前使用分页

 

 五、通过控制器传递到页面的page对象中保存有总页数,总记录数,当前页等信息