boot(1.4.0) \"Pageable\" for pagination.It works fine without any issue.But by default the page value starts from \"0\" but in the front-end the page value starts from \"1\". So
To get better result, you need to extend RepositoryRestMvcConfiguration, like below
@Configuration
public class RespositoryConfiguration extends RepositoryRestMvcConfiguration {
@Override
@Bean
public HateoasPageableHandlerMethodArgumentResolver pageableResolver() {
HateoasPageableHandlerMethodArgumentResolver resolver = super.pageableResolver();
resolver.setOneIndexedParameters(true);
return resolver;
}
}
Then you shall get all the links and pagination information correct except 'number', which is one less. See the result for page=1,
"_links": {
"first": {
"href": "http://localhost:8080/user/user?page=1&size=5"
},
"self": {
"href": "http://localhost:8080/user/user"
},
"next": {
"href": "http://localhost:8080/user/user?page=2&size=5"
},
"last": {
"href": "http://localhost:8080/user/user?page=2&size=5"
}
},
"page": {
"size": 5,
"totalElements": 6,
"totalPages": 2,
"number": 0
}