spring boot 2.0 提示 No primary or default constructor found for interface Pageable 解决办法
2024-09-06 16:27:51
在SpringBoot 2.0 以前,我们会配置以下类
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter 可见方法已经过期,SpringBoot 2.0 建议继承此配置类
@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport { 然后你会发现Controller中无法注入Pageable了,错误提示如下
No primary or default constructor found for interface org.springframework.data.domain.Pageable
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
// 注册Spring data jpa pageable的参数分解器
argumentResolvers.add(new PageableHandlerMethodArgumentResolver());
}
最新文章
- OpenGL学习进程(13)第十课:基本图形的底层实现及算法原理
- windows下运行的linux服务器批量管理工具(带UI界面)
- Node.js的学习--使用cheerio抓取网页数据
- 让css初学者抓狂的属性float
- android的jni
- Codeforces Round #333 (Div. 1) C. Kleof&#225;š and the n-thlon 树状数组优化dp
- [Linux]root默认密码问题
- 解决 子进程已安装的 post-removal脚本返回了错误号 100 的方法
- delphi客户端调服务器端的java webservice如何在参数中传对象? 转
- Redis 学习之事务处理
- require和import区别
- css预编译语言sass——mixin的使用
- luogu P2331 [SCOI2005]最大子矩阵
- 微信UnionId 部分开放
- noip2017d2t2
- JQuery快速入门-选择器
- leetCode题解之Array Partition I
- 读 Zepto 源码系列
- C#-WebForm-★★★JQuery知识——基础知识、选择器、事件★★★
- Python中的一些函数