spring-projects / spring-projects/spring-data-commons

EnableSpringDataWebSupport causes paging to ignore properties

Open
#3,320 1 comment 2 reactions 1 assignee View on GitHub

@mp911de is already working on this.

Since Jul 14, 2025.

status: waiting-for-triage
Dominant language
Java
Stars
838
Forks
730
PR merge metrics
No merged PRs in 30d

Description

Spring Boot : 3.4.6
Spring Data Commons : 3.4.6

When @EnableSpringDataWebSupport(pageSerializationMode = VIA_DTO) is used as described in https://docs.spring.io/spring-data/commons/reference/repositories/core-extensions.html#core.web.pageables

The properties defined under spring.data.web.pageable are ignored. e.g. max-page-size

Workaround :

... Configuration class implementing PageableHandlerMethodArgumentResolverCustomizer

/*
Workaround
A PageableHandlerMethodArgumentResolver bean is instantiated by SpringDataWebConfiguration. As a result
SpringDataWebAutoConfiguration cannot call pageableCustomizer to load the properties defined in SpringDataWebProperties.
*/
@Override
public void customize(PageableHandlerMethodArgumentResolver pageableResolver) {
pageableResolver.setMaxPageSize(5000);
pageableResolver.setFallbackPageable(Pageable.unpaged());
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.