org.springframework.data.domain.Pageable最大分页大小要怎么设置

后端用org.springframework.data.domain.Pageable分页,pageSize是不是有限制,前端请求给的参数pageSize大于100时,后端接收到的Pageable的pageSize都是100,这个最大分页大小要怎么设置

查了官方文档,但是没看出个所以然来
https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/domain/Pageable.html

img

img


size本身只要不小于1就可以了,具体限制还得看自己有没有再次封装做限制

不知道是不是Pageable没有设置页面大小的方法

org.springframework.data.domain
Class PageRequest
java.lang.Object
org.springframework.data.domain.AbstractPageRequest
org.springframework.data.domain.PageRequest
All Implemented Interfaces:
Serializable, Pageable

public class PageRequest
extends AbstractPageRequest
Basic Java Bean implementation of Pageable.

找了一下官网,PageRequest实现了Pageable接口,有 ofSize(int pageSize)、of(int page, int size)方法可以设置页面大小
https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/domain/PageRequest.html

img


没有限制啊