Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

387
Vistas
spring boot pageable configure params name

I am using Spring Boot v1.5.2.RELEASE.

My controller is like this:

@PostMapping(path = "/list_praxis")
public
@ResponseBody
ModelAndView login(Pageable pageable,HttpServletRequest request) {
    return new ModelAndView(new WebJsonView());
}

My parameters size:10 page:0, Pageable works fine.

But now I want to change my parameters to pageSize:10 currentPage:0.

Pageable doesn't work, because pageable can only receive size and page, and doesn't support other parameter names.

How can I configure this to use pageSize and currentPage instead of size and page?

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You can also use spring's application properties like this

spring.data.web.pageable.page-parameter: pageNumber
spring.data.web.pageable.size-parameter: pageSize

You can learn about other common application properties here.

about 4 years ago · Santiago Trujillo Denunciar

0

I think this would work for you.

@Configuration
public class RepositoryRestMvcConfiguration extends SpringBootRepositoryRestMvcConfiguration{

    @Override
    protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
           config.setPageParamName("p")
                 .setLimitParamName("l")
                 .setSortParamName("s");
    }
}
This configuration would set the paging parameter to p, the size parameter to l, and the sort parameter to s:

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda