基于SSM框架的管理系统:分页功能
目录
二、更新配置文件applicationContext.xml
三、修改业务层中展示用户信息的方法,添加page、size整型参数
四、修改控制层中展示用户信息的方法,添加page、size整型参数,并把列表封装到PageInfo对象里
一、导入jar包
在配置文件pom.xml中加入pagehelper的导入信息:
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.2</version>
</dependency>
二、更新配置文件applicationContext.xml
告诉mybatis要用到pagehelper,在applicationContext.xml中添加:
<property name="plugins">
<array>
<bean class="com.github.pagehelper.PageInterceptor">
<property name="properties">
<props>
<prop key="helperDialect">mysql</prop>
<prop key="reasonable">true</prop>
</props>
</property>
</bean>
</array>
</property>