【问题标题】:When pagedlistholder is used to paginate, why does the pagination content not change at all when current and PageSize change使用pagedlistholder分页时,为什么current和PageSize发生变化时分页内容完全没有变化
【发布时间】:2021-05-22 12:40:40
【问题描述】:
PagedListHolder<UserArticleVo> userAritcleListPage=new PagedListHolder<>(userArticleVoList);
        userAritcleListPage.setPage(current-1);
        userAritcleListPage.setPageSize(10);
        return userAritcleListPage;

当currentPage切换到像两颗豌豆一样时,页面不应该显示内容,但页面内容与第一页完全相同。

【问题讨论】:

    标签: java spring spring-boot spring-data-jpa


    【解决方案1】:

    我想我已经解决了,这是原来控制层的代码

    List<UserArticleVo> articleList = articleListPage.getSource();
    

    getSource()此方法获取源数据,而不是分页内容

    应该改用以下方法

    List<UserArticleVo> articleList = articleListPage.getPageList();
    

    【讨论】:

      猜你喜欢
      • 2017-01-29
      • 1970-01-01
      • 2020-10-08
      • 2016-08-03
      • 1970-01-01
      • 2023-03-15
      • 1970-01-01
      • 2012-11-14
      • 1970-01-01
      相关资源
      最近更新 更多