Java Code Examples for org.springframework.data.web.PageableHandlerMethodArgumentResolver#setFallbackPageable()

The following examples show how to use org.springframework.data.web.PageableHandlerMethodArgumentResolver#setFallbackPageable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WebMvcConfig.java    From apollo with Apache License 2.0 5 votes vote down vote up
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
  PageableHandlerMethodArgumentResolver pageResolver =
          new PageableHandlerMethodArgumentResolver();
  pageResolver.setFallbackPageable(PageRequest.of(0, 10));

  argumentResolvers.add(pageResolver);
}
 
Example 2
Source File: WebConfig.java    From todolist with MIT License 5 votes vote down vote up
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
    PageableHandlerMethodArgumentResolver resolver = new PageableHandlerMethodArgumentResolver();
    resolver.setOneIndexedParameters(true);
    resolver.setFallbackPageable(new PageRequest(0, 10));
    argumentResolvers.add(resolver);
    super.addArgumentResolvers(argumentResolvers);
}
 
Example 3
Source File: RestControllerTestSupport.java    From fullstop with Apache License 2.0 5 votes vote down vote up
protected HandlerMethodArgumentResolver[] mockMvcCustomArgumentResolvers() {
    final PageableHandlerMethodArgumentResolver pageableResolver = new PageableHandlerMethodArgumentResolver();
    pageableResolver.setFallbackPageable(new PageRequest(0, 10));

    final AuthenticationPrincipalArgumentResolver authenticationPrincipalResolver = new AuthenticationPrincipalArgumentResolver();

    return new HandlerMethodArgumentResolver[] { pageableResolver, authenticationPrincipalResolver };
}