Class PaginationCustomizationAutoConfig

java.lang.Object
in.co.akshitbansal.springwebquery.config.pageable.PaginationCustomizationAutoConfig

@AutoConfiguration public class PaginationCustomizationAutoConfig extends Object
Contributes pagination customization for Spring Data Web's shared PageableHandlerMethodArgumentResolver.

When Spring Data Web support is active, Spring creates a central PageableHandlerMethodArgumentResolver to parse request parameters such as page, size, and sort. Spring looks up any PageableHandlerMethodArgumentResolverCustomizer beans in the application context and invokes them while building that resolver, allowing starter code to adjust the resolver without replacing Spring's default infrastructure.

This auto-configuration provides one such customizer bean. It validates the configured pagination properties and then applies the starter's global max page size and fallback page size to the resolver that Spring Data Web exposes to MVC argument resolution.

  • Constructor Details

    • PaginationCustomizationAutoConfig

      public PaginationCustomizationAutoConfig()
  • Method Details

    • maxPageSizeCustomizer

      @Bean public org.springframework.data.web.config.PageableHandlerMethodArgumentResolverCustomizer maxPageSizeCustomizer(@Value("${spring-web-query.pagination.max-page-size:100}") int MAX_PAGE_SIZE, @Value("${spring-web-query.pagination.default-page-size:20}") int DEFAULT_PAGE_SIZE)