本文整理汇总了Java中org.springframework.data.web.PageableHandlerMethodArgumentResolver.setFallbackPageable方法的典型用法代码示例。如果您正苦于以下问题:Java PageableHandlerMethodArgumentResolver.setFallbackPageable方法的具体用法?Java PageableHandlerMethodArgumentResolver.setFallbackPageable怎么用?Java PageableHandlerMethodArgumentResolver.setFallbackPageable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.data.web.PageableHandlerMethodArgumentResolver
的用法示例。
在下文中一共展示了PageableHandlerMethodArgumentResolver.setFallbackPageable方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addArgumentResolvers
import org.springframework.data.web.PageableHandlerMethodArgumentResolver; //导入方法依赖的package包/类
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
Sort defaultSort = new Sort(new Sort.Order(Sort.Direction.ASC, "id"));
Pageable defaultPage = new PageRequest(0, 10, defaultSort);
SortHandlerMethodArgumentResolver sortHandlerMethodArgumentResolver = new SortHandlerMethodArgumentResolver();
sortHandlerMethodArgumentResolver.setSortParameter("sort");
sortHandlerMethodArgumentResolver.setFallbackSort(defaultSort);
PageableHandlerMethodArgumentResolver pageableResolver = new PageableHandlerMethodArgumentResolver();
pageableResolver.setMaxPageSize(100);
pageableResolver.setOneIndexedParameters(false);
pageableResolver.setPageParameterName("page");
pageableResolver.setSizeParameterName("size");
pageableResolver.setFallbackPageable(defaultPage);
argumentResolvers.add(sortHandlerMethodArgumentResolver);
argumentResolvers.add(pageableResolver);
}
示例2: addArgumentResolvers
import org.springframework.data.web.PageableHandlerMethodArgumentResolver; //导入方法依赖的package包/类
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
PageableHandlerMethodArgumentResolver pageResolver =
new PageableHandlerMethodArgumentResolver();
pageResolver.setFallbackPageable(new PageRequest(0, 10));
argumentResolvers.add(pageResolver);
}
示例3: addArgumentResolvers
import org.springframework.data.web.PageableHandlerMethodArgumentResolver; //导入方法依赖的package包/类
@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);
}
示例4: addArgumentResolvers
import org.springframework.data.web.PageableHandlerMethodArgumentResolver; //导入方法依赖的package包/类
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
PageableHandlerMethodArgumentResolver pageableHandlerMethodArgumentResolver = new PageableHandlerMethodArgumentResolver();
pageableHandlerMethodArgumentResolver.setMaxPageSize(20);
pageableHandlerMethodArgumentResolver
.setFallbackPageable(new PageRequest(0, 20, new Sort(Direction.DESC, "dateCreated")));
argumentResolvers.add(pageableHandlerMethodArgumentResolver);
}
示例5: addArgumentResolvers
import org.springframework.data.web.PageableHandlerMethodArgumentResolver; //导入方法依赖的package包/类
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
PageableHandlerMethodArgumentResolver resolver = new PageableHandlerMethodArgumentResolver();
resolver.setFallbackPageable(new PageRequest(
Pagination.DEFAULT_PAGE_NUMBER,
Pagination.NO_PAGINATION));
argumentResolvers.add(resolver);
super.addArgumentResolvers(argumentResolvers);
}
示例6: mockMvcCustomArgumentResolvers
import org.springframework.data.web.PageableHandlerMethodArgumentResolver; //导入方法依赖的package包/类
protected HandlerMethodArgumentResolver[] mockMvcCustomArgumentResolvers() {
final PageableHandlerMethodArgumentResolver pageableResolver = new PageableHandlerMethodArgumentResolver();
pageableResolver.setFallbackPageable(new PageRequest(0, 10));
final AuthenticationPrincipalArgumentResolver authenticationPrincipalResolver = new AuthenticationPrincipalArgumentResolver();
return new HandlerMethodArgumentResolver[] { pageableResolver, authenticationPrincipalResolver };
}
示例7: getPageableHandlerMethodArgumentResolver
import org.springframework.data.web.PageableHandlerMethodArgumentResolver; //导入方法依赖的package包/类
public static PageableHandlerMethodArgumentResolver getPageableHandlerMethodArgumentResolver() {
PageableHandlerMethodArgumentResolver resolver = new PageableHandlerMethodArgumentResolver();
resolver.setMaxPageSize(Integer.MAX_VALUE);
resolver.setFallbackPageable(new PageRequest(0, Integer.MAX_VALUE, null));
//resolver.setPrefix("page.");
resolver.setOneIndexedParameters(true);
return resolver;
}
示例8: addArgumentResolvers
import org.springframework.data.web.PageableHandlerMethodArgumentResolver; //导入方法依赖的package包/类
@Override
public void addArgumentResolvers(
List<HandlerMethodArgumentResolver> argumentResolvers) {
PageableHandlerMethodArgumentResolver resolver = new PageableHandlerMethodArgumentResolver();
resolver.setOneIndexedParameters(true);
resolver.setFallbackPageable(new PageRequest(1, 10));
argumentResolvers.add(resolver);
}
示例9: addArgumentResolvers
import org.springframework.data.web.PageableHandlerMethodArgumentResolver; //导入方法依赖的package包/类
@Override
public void addArgumentResolvers(
List<HandlerMethodArgumentResolver> argumentResolvers) {
PageableHandlerMethodArgumentResolver resolver = new PageableHandlerMethodArgumentResolver();
resolver.setFallbackPageable(new PageRequest(1, 20));
resolver.setMaxPageSize(Integer.MAX_VALUE);
argumentResolvers.add(resolver);
}
示例10: addArgumentResolvers
import org.springframework.data.web.PageableHandlerMethodArgumentResolver; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void addArgumentResolvers(
List<HandlerMethodArgumentResolver> argumentResolvers) {
PageableHandlerMethodArgumentResolver resolver =
new PageableHandlerMethodArgumentResolver();
resolver.setFallbackPageable(new PageRequest(0, FALLBACK_PAGE_SIZE));
argumentResolvers.add(resolver);
}
示例11: pageableResolver
import org.springframework.data.web.PageableHandlerMethodArgumentResolver; //导入方法依赖的package包/类
/**
* Set up a {@link PageableHandlerMethodArgumentResolver}
* to automatically extract paging parameters from a
* request
* @return
*/
@Bean
public PageableHandlerMethodArgumentResolver pageableResolver() {
PageableHandlerMethodArgumentResolver pageArgResolver = new PageableHandlerMethodArgumentResolver();
Pageable fallback = new PageRequest(0, 20);
pageArgResolver.setFallbackPageable(fallback);
return pageArgResolver;
}
示例12: pageableHandlerMethodArgumentResolver
import org.springframework.data.web.PageableHandlerMethodArgumentResolver; //导入方法依赖的package包/类
@Bean
public PageableHandlerMethodArgumentResolver pageableHandlerMethodArgumentResolver() {
final PageableHandlerMethodArgumentResolver argumentResolver = new PageableHandlerMethodArgumentResolver();
argumentResolver.setFallbackPageable(new PageRequest(0, 10));
return argumentResolver;
}
示例13: modifyPageableHandlerMethodArgumentResolver
import org.springframework.data.web.PageableHandlerMethodArgumentResolver; //导入方法依赖的package包/类
@Bean
public PageableHandlerMethodArgumentResolver modifyPageableHandlerMethodArgumentResolver(PageableHandlerMethodArgumentResolver resolver) {
resolver.setFallbackPageable(new PageRequest(0, 4));
resolver.setMaxPageSize(30);
return resolver;
}
示例14: modifyPageableHandlerMethodArgumentResolver
import org.springframework.data.web.PageableHandlerMethodArgumentResolver; //导入方法依赖的package包/类
@Bean
public PageableHandlerMethodArgumentResolver modifyPageableHandlerMethodArgumentResolver(PageableHandlerMethodArgumentResolver resolver) {
resolver.setFallbackPageable(ConstantsForTests.DEFAULT_PAGE_REQUEST);
resolver.setMaxPageSize(30);
return resolver;
}