解决方法:版本不对,使用1.4.6
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.4.6</version>
</dependency>
讲一下:pagehelper的配置
如果你的项目跟我一样,是springboot项目,则在pox.xml中引入这个依赖,然后在service或者controller层使用这个语句就可以了。我试了在配置文件中不配置也可运行。
PageHelper.startPage(pageNum, pageSize);