当前位置: 首页>>代码示例>>Java>>正文


Java PageableHandlerMethodArgumentResolver.setFallbackPageable方法代码示例

本文整理汇总了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);
}
 
开发者ID:shilongdai,项目名称:bookManager,代码行数:20,代码来源:ServletApplicationContextConfig.java

示例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);
}
 
开发者ID:dewey-its,项目名称:apollo-custom,代码行数:9,代码来源:WebMvcConfig.java

示例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);
}
 
开发者ID:nonocast,项目名称:todolist,代码行数:9,代码来源:WebConfig.java

示例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);
}
 
开发者ID:ksambhav,项目名称:trueyes,代码行数:10,代码来源:CoreWebConfiguration.java

示例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);
}
 
开发者ID:OpenLMIS,项目名称:openlmis-template-service,代码行数:10,代码来源:CustomWebMvcConfigurerAdapter.java

示例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 };
}
 
开发者ID:zalando-stups,项目名称:fullstop,代码行数:9,代码来源:RestControllerTestSupport.java

示例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;
}
 
开发者ID:srinikandula,项目名称:mybus,代码行数:9,代码来源:WebApplicationConfig.java

示例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);
}
 
开发者ID:barrantesgerman,项目名称:ciea,代码行数:9,代码来源:MvcConfig.java

示例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);
}
 
开发者ID:vpechorin,项目名称:kontempl,代码行数:11,代码来源:WebConfig.java

示例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);
}
 
开发者ID:opensource21,项目名称:fuwesta,代码行数:12,代码来源:WebMvcConfig.java

示例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;
}
 
开发者ID:patrickvankann,项目名称:bjug-querydsl,代码行数:14,代码来源:WebConfig.java

示例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;
}
 
开发者ID:martinlau,项目名称:unidle-old,代码行数:9,代码来源:MvcConfiguration.java

示例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;
}
 
开发者ID:mikehartley,项目名称:yottr,代码行数:7,代码来源:AppConfig.java

示例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;
}
 
开发者ID:mikehartley,项目名称:yottr,代码行数:7,代码来源:ControllerTestConfig.java


注:本文中的org.springframework.data.web.PageableHandlerMethodArgumentResolver.setFallbackPageable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。