在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());
}

spring boot 2.0 提示 No primary or default constructor found for interface Pageable 解决办法的更多相关文章

  1. SpringMVC开发中遇到的异常1:No primary or default constructor found for interface java.util.List

    Request processing failed; nested exception is java.lang.IllegalStateException: No primary or defaul ...

  2. spring boot无法启动,或者正常启动之后无法访问报404的解决办法

    以前用spring boot都是用idea的自动创建,或者是用的Jhipster创建的,就没有深究怎么去搭建.但是今天晚上心血来潮,想自己搭一个demo来整合一些技术,于是就花一点时间来手动搭.因为今 ...

  3. Spring Boot 2.0 版的开源项目云收藏来了!

    给大家聊一聊云收藏从 Spring Boot 1.0 升级到 2.0 所踩的坑 先给大家晒一下云收藏的几个数据,作为一个 Spring Boot 的开源项目(https://github.com/cl ...

  4. spring boot 2.0 源码分析(三)

    通过上一章的源码分析,我们知道了spring boot里面的listeners到底是什么(META-INF/spring.factories定义的资源的实例),以及它是创建和启动的,今天我们继续深入分 ...

  5. Spring Boot 2.0 的快速入门(图文教程)

    摘要: 原创出处 https://www.bysocket.com 「公众号:泥瓦匠BYSocket 」欢迎关注和转载,保留摘要,谢谢! Spring Boot 2.0 的快速入门(图文教程) 大家都 ...

  6. 【SFA官方翻译】使用 Kubernetes、Spring Boot 2.0 和 Docker 的微服务快速指南

    [SFA官方翻译]使用 Kubernetes.Spring Boot 2.0 和 Docker 的微服务快速指南 原创: Darren Luo SpringForAll社区 今天 原文链接:https ...

  7. Quick Guide to Microservices with Spring Boot 2.0, Eureka and Spring Cloud

    https://piotrminkowski.wordpress.com/2018/04/26/quick-guide-to-microservices-with-spring-boot-2-0-eu ...

  8. 195. Spring Boot 2.0数据库迁移:Flyway

    [视频&交流平台] àSpringBoot视频:http://t.cn/R3QepWG à SpringCloud视频:http://t.cn/R3QeRZc à Spring Boot源码: ...

  9. spring boot 2.0 源码分析(一)

    在学习spring boot 2.0源码之前,我们先利用spring initializr快速地创建一个基本的简单的示例: 1.先从创建示例中的main函数开始读起: package com.exam ...

随机推荐

  1. 浙江省赛C.Array in the Pocket(贪心+线段树)

    题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4102 题意: 给出一个长度为n的数组,重排它们,让相同位置的数 ...

  2. tomcat在浏览器输入用户名和密码后报错Tomcat Manager App--403 Access Denied You are not authorized to view this page

    报错截图:Tomcat Manager App--403 Access Denied You are not authorized to view this page 解决办法: 1.关闭Tomcat ...

  3. Jinja2学习

    模板: 知名模板引擎:jinja2(flask默认的模板引擎) Mako template模板路径: 1.在渲染模板的时候,会默认从根目录下的templates目录下查找模板文件 2.也可以自定义模板 ...

  4. RHEL防火墙命令

    firewall-cmd --state 查看防火墙状态 firewall-cmd --reload #重启firewall systemctl stop firewalld.service #停止f ...

  5. windows服务器安装nodejs实现自动计划

    直接官网打开:https://nodejs.org/en/ 下载相应的系统nodejs版本直接安装后,通过命令行window+r    输入node + web(目录)+\pubils\app.js  ...

  6. legend3---10、vue与lavarel的blade模板加jquery页面开发方式比较

    legend3---10.vue与lavarel的blade模板加jquery页面开发方式比较 一.总结 一句话总结: lavarel的blade模板加jquery:速度快一点:速度快一点,页面加载数 ...

  7. nodejs服务端实现post请求

    博客之前写过一篇php实现post请求的文章. 今天想到好久没有输出了,重新认识到输出的重要性.百般思索该写些什么?想来想去,想到了两点: 逐步熟练nodejs各种场景知识,针对mysql数据交互和f ...

  8. Smarty section、foreach控制循环次数的实现详解

    <!--{ section name='i' loop=$a }--><!--{ if $smarty.section.i.index < 3 }--><!--{  ...

  9. 用C#做成的程序如何打包部署,在其他PC机运行

    刚刚接触C#,在linux下面做习惯了c和c++,在本机运行OK后,得瑟的去别的机子,居然运行不了,你妹啊,怎么回事,没有.NET Framework,原来和java类似,.NET Framework ...

  10. Linux新增开放端口

    CentOS系统 开放端口的方法: 方法一:命令行方式               1. 开放端口命令: /sbin/iptables -I INPUT -p tcp --dport 8080 -j ...