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


Java PagedListHolder.setPageSize方法代码示例

本文整理汇总了Java中org.springframework.beans.support.PagedListHolder.setPageSize方法的典型用法代码示例。如果您正苦于以下问题:Java PagedListHolder.setPageSize方法的具体用法?Java PagedListHolder.setPageSize怎么用?Java PagedListHolder.setPageSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.beans.support.PagedListHolder的用法示例。


在下文中一共展示了PagedListHolder.setPageSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleRequest

import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
	String username = request.getParameter("username");
	String password = request.getParameter("password");
	Account account = this.petStore.getAccount(username, password);
	if (account == null) {
		return new ModelAndView("Error", "message", "Invalid username or password.  Signon failed.");
	}
	else {
		UserSession userSession = new UserSession(account);
		PagedListHolder myList = new PagedListHolder(this.petStore.getProductListByCategory(account.getFavouriteCategoryId()));
		myList.setPageSize(4);
		userSession.setMyList(myList);
		request.getSession().setAttribute("userSession", userSession);
		String forwardAction = request.getParameter("forwardAction");
		if (forwardAction != null) {
			response.sendRedirect(forwardAction);
			return null;
		}
		else {
			return new ModelAndView("index");
		}
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:24,代码来源:SignonController.java

示例2: doExecute

import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
  AccountActionForm acctForm = (AccountActionForm) form;
if (AccountActionForm.VALIDATE_EDIT_ACCOUNT.equals(acctForm.getValidate())) {
	acctForm.getAccount().setListOption(request.getParameter("account.listOption") != null);
	acctForm.getAccount().setBannerOption(request.getParameter("account.bannerOption") != null);
	Account account = acctForm.getAccount();
	getPetStore().updateAccount(account);
	acctForm.setAccount(getPetStore().getAccount(account.getUsername()));
	PagedListHolder myList = new PagedListHolder(getPetStore().getProductListByCategory(account.getFavouriteCategoryId()));
	myList.setPageSize(4);
	acctForm.setMyList(myList);
	request.getSession().setAttribute("accountForm", acctForm);
	request.getSession().removeAttribute("workingAccountForm");
	return mapping.findForward("success");
}
else {
	request.setAttribute("message", "Your account was not updated because the submitted information was not validated.");
	return mapping.findForward("failure");
}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:21,代码来源:EditAccountAction.java

示例3: execute

import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
  AccountActionForm acctForm = (AccountActionForm) form;
if (AccountActionForm.VALIDATE_NEW_ACCOUNT.equals(acctForm.getValidate())) {
	acctForm.getAccount().setListOption(request.getParameter("account.listOption") != null);
	acctForm.getAccount().setBannerOption(request.getParameter("account.bannerOption") != null);
	Account account = acctForm.getAccount();
	String username = acctForm.getAccount().getUsername();
	getPetStore().insertAccount(account);
	acctForm.setAccount(getPetStore().getAccount(username));
	PagedListHolder myList = new PagedListHolder(getPetStore().getProductListByCategory(account.getFavouriteCategoryId()));
	myList.setPageSize(4);
	acctForm.setMyList(myList);
	request.getSession().setAttribute("accountForm", acctForm);
	request.getSession().removeAttribute("workingAccountForm");
	return mapping.findForward("success");
}
else {
	request.setAttribute("message", "Your account was not created because the submitted information was not validated.");
	return mapping.findForward("failure");
}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:22,代码来源:NewAccountAction.java

示例4: getPhotoBook

import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
public PagedListHolder<SpacePhoto> getPhotoBook(List<SpacePhoto> photos, String pageString) {
    PagedListHolder<SpacePhoto> book = new PagedListHolder<>(photos);
    book.setPageSize(PHOTOS_IN_PAGE);
    int page = 0;

    if (Strings.isNullOrEmpty(pageString)) {
        page = 0;
    } else {
        try {
            page = Integer.parseInt(pageString);
        } catch (NumberFormatException nfe) {
            if ("f".equals(pageString)) {
                page = 0;
            } else if ("l".equals(pageString)) {
                page = book.getPageCount();
            }
        }
    }
    book.setPage(page == 0 ? 0 : page - 1);
    return book;
}
 
开发者ID:FenixEdu,项目名称:fenixedu-spaces,代码行数:22,代码来源:SpacePhotoService.java

示例5: getSubmissionBook

import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
public PagedListHolder<SpacePhotoSubmission> getSubmissionBook(List<SpacePhotoSubmission> submissions, String pageString) {
    PagedListHolder<SpacePhotoSubmission> book = new PagedListHolder<>(submissions);
    book.setPageSize(PHOTOS_IN_PAGE);
    int page = 0;

    if (Strings.isNullOrEmpty(pageString)) {
        page = 0;
    } else {
        try {
            page = Integer.parseInt(pageString);
        } catch (NumberFormatException nfe) {
            if ("f".equals(pageString)) {
                page = 0;
            } else if ("l".equals(pageString)) {
                page = book.getPageCount();
            }
        }
    }
    book.setPage(page == 0 ? 0 : page - 1);
    return book;
}
 
开发者ID:FenixEdu,项目名称:fenixedu-spaces,代码行数:22,代码来源:SpacePhotoService.java

示例6: getBook

import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
public PagedListHolder<OccupationRequest> getBook(List<OccupationRequest> requests, String pageString) {
    PagedListHolder<OccupationRequest> book = new PagedListHolder<>(requests);
    book.setPageSize(30);
    int page = 0;

    if (Strings.isNullOrEmpty(pageString)) {
        page = 0;
    } else {
        try {
            page = Integer.parseInt(pageString);
        } catch (NumberFormatException nfe) {
            if ("f".equals(pageString)) {
                page = 0;
            } else if ("l".equals(pageString)) {
                page = book.getPageCount();
            }
        }
    }
    book.setPage(page == 0 ? 0 : page - 1);
    return book;
}
 
开发者ID:FenixEdu,项目名称:fenixedu-spaces,代码行数:22,代码来源:OccupationService.java

示例7: handleRequestInternal

import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    logger.debug("start: reload reporting configuration files");
    // TODO indigo: We have to solve this problem on DAO level
    synchronized (m_reportListService) {
      m_reportListService.reloadConfigurationFiles();
    }
    logger.debug("stop : reload reporting configuration files");

    Map<ReportRepositoryDescription, PagedListHolder<DatabaseReportDescription>> repositoryList = new LinkedHashMap<ReportRepositoryDescription, PagedListHolder<DatabaseReportDescription>>();
    for (ReportRepositoryDescription reportRepositoryDescription : m_reportListService.getActiveRepositories()) {
        PagedListHolder<DatabaseReportDescription> pageListholder = new PagedListHolder<DatabaseReportDescription>(m_reportListService.getReportsByRepositoryId(reportRepositoryDescription.getId()));
        pageListholder.setPageSize(m_pageSize);
        int page = ServletRequestUtils.getIntParameter(request, "p_" + reportRepositoryDescription.getId(), 0);
        pageListholder.setPage(page);
        repositoryList.put(reportRepositoryDescription, pageListholder);
    }
    return new ModelAndView("report/database/reportList", "repositoryList", repositoryList);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:22,代码来源:ReportListController.java

示例8: handleRequestInternal

import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request,
                                             HttpServletResponse response) throws Exception {
    Map<ReportRepositoryDescription, PagedListHolder<DatabaseReportDescription>> repositoryList = new LinkedHashMap<ReportRepositoryDescription, PagedListHolder <DatabaseReportDescription>>();

    // Go through all active repositories and get all reports for each repository
    for (ReportRepositoryDescription reportRepositoryDescription : m_reportListService.getActiveRepositories()) {
        PagedListHolder<DatabaseReportDescription> pageListholder = new PagedListHolder<DatabaseReportDescription>(m_reportListService.getReportsByRepositoryId(reportRepositoryDescription.getId()));
        pageListholder.setPageSize(m_pageSize);
        int page = ServletRequestUtils.getIntParameter(request,"p_" + reportRepositoryDescription.getId(),0);
        pageListholder.setPage(page);
        repositoryList.put(reportRepositoryDescription, pageListholder);
    }
    return new ModelAndView("report/database/batchList","repositoryList", repositoryList);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:17,代码来源:BatchReportListController.java

示例9: pagedListImpl

import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
@Override
public PagedListHolder pagedListImpl(int size, HttpServletRequest request, List pageSource) {
    pagedListHolder = new PagedListHolder(pageSource);
    pagedListHolder.setPage(ServletRequestUtils.getIntParameter(request, "page", 0));
    pagedListHolder.setPageSize(size);
    return pagedListHolder;
}
 
开发者ID:Recks11,项目名称:theLXGweb,代码行数:8,代码来源:pagination.java

示例10: pagedProductsPage

import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@RequestMapping(value = "/products/page/{pageNumber}", method = RequestMethod.GET)
public String pagedProductsPage(HttpServletRequest request, @PathVariable Integer pageNumber, Model uiModel) {

	logger.debug("Showing paged products page # {}", pageNumber);
	PagedListHolder<Product> pagedListHolder = (PagedListHolder<Product>) request.getSession()
			.getAttribute(SESSION_ATTRIBUTE_PRODUCTLIST);

	if (pagedListHolder == null) {
		pagedListHolder = new PagedListHolder<Product>(productService.getProducts());
		pagedListHolder.setPageSize(PRODUCT_LIST_PAGE_SIZE);

	} else {

		final int goToPage = pageNumber - 1;
		if (goToPage <= pagedListHolder.getPageCount() && goToPage >= 0) {
			pagedListHolder.setPage(goToPage);
		}
	}

	request.getSession().setAttribute(SESSION_ATTRIBUTE_PRODUCTLIST, pagedListHolder);

	uiModel.addAttribute(MODEL_ATTRIBUTE_PAGER, currentPage(pagedListHolder));
	uiModel.addAttribute(MODEL_ATTRIBUTE_PRODUCTS, pagedListHolder);

	return PRODUCT_LIST_VIEW;
}
 
开发者ID:mintster,项目名称:nixmash-blog,代码行数:28,代码来源:SolrController.java

示例11: processFindForm

import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
@RequestMapping(value = "/products/list", method = RequestMethod.GET)
public String processFindForm(UserQuery userQuery, BindingResult result, Model model, HttpServletRequest request) {
	List<Product> results = null;

	Boolean isSimpleTermQuery = userQuery.getQuery().matches("[a-zA-Z_0-9 ]*");

	if (StringUtils.isEmpty(userQuery.getQuery())) {
		return "redirect:/products/search";
	} else
		try {
			if (isSimpleTermQuery) {
				HighlightPage<Product> highlightedResults = productService
						.findByHighlightedNameCriteria(userQuery.getQuery());
				results = SolrUtils.highlightPagesToList(highlightedResults);
			} else {
				results = productService.getProductsWithUserQuery(userQuery.getQuery());
			}
		} catch (UncategorizedSolrException ex) {
			logger.info(MessageFormat.format("Bad Query: {0}", userQuery.getQuery()));
			result.rejectValue("query", "product.search.error", new Object[] { userQuery.getQuery() }, "not found");
			return PRODUCT_SEARCH_VIEW;
		}

	if (results.size() < 1) {
		result.rejectValue("query", "product.search.noresults", new Object[] { userQuery.getQuery() }, "not found");
		return PRODUCT_SEARCH_VIEW;
	}

	if (results.size() > 1) {
		PagedListHolder<Product> pagedListHolder = new PagedListHolder<Product>(results);
		pagedListHolder.setPageSize(PRODUCT_LIST_PAGE_SIZE);
		request.getSession().setAttribute(SESSION_ATTRIBUTE_PRODUCTLIST, pagedListHolder);
		return "redirect:/products/page/1";
	} else {
		Product product = results.iterator().next();
		return "redirect:/products/" + product.getId();
	}
}
 
开发者ID:mintster,项目名称:nixmash-blog,代码行数:39,代码来源:SolrController.java

示例12: onSubmit

import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
protected ModelAndView onSubmit(
		HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
		throws Exception {

	AccountForm accountForm = (AccountForm) command;
	try {
		if (accountForm.isNewAccount()) {
			this.petStore.insertAccount(accountForm.getAccount());
		}
		else {
			this.petStore.updateAccount(accountForm.getAccount());
		}
	}
	catch (DataIntegrityViolationException ex) {
		errors.rejectValue("account.username", "USER_ID_ALREADY_EXISTS",
				"User ID already exists: choose a different ID.");
		return showForm(request, response, errors);
	}
	
	UserSession userSession = new UserSession(this.petStore.getAccount(accountForm.getAccount().getUsername()));
	PagedListHolder myList = new PagedListHolder(
			this.petStore.getProductListByCategory(accountForm.getAccount().getFavouriteCategoryId()));
	myList.setPageSize(4);
	userSession.setMyList(myList);
	request.getSession().setAttribute("userSession", userSession);
	return super.onSubmit(request, response, command, errors);
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:28,代码来源:AccountFormController.java

示例13: execute

import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
  request.getSession().removeAttribute("workingAccountForm");
  request.getSession().removeAttribute("accountForm");
  if (request.getParameter("signoff") != null) {
    request.getSession().invalidate();
    return mapping.findForward("success");
  }
else {
    AccountActionForm acctForm = (AccountActionForm) form;
    String username = acctForm.getUsername();
    String password = acctForm.getPassword();
    Account account = getPetStore().getAccount(username, password);
    if (account == null) {
      request.setAttribute("message", "Invalid username or password.  Signon failed.");
      return mapping.findForward("failure");
    }
	else {
		String forwardAction = acctForm.getForwardAction();
		acctForm = new AccountActionForm();
		acctForm.setForwardAction(forwardAction);
      acctForm.setAccount(account);
      acctForm.getAccount().setPassword(null);
      PagedListHolder myList = new PagedListHolder(getPetStore().getProductListByCategory(account.getFavouriteCategoryId()));
		myList.setPageSize(4);
		acctForm.setMyList(myList);
		request.getSession().setAttribute("accountForm", acctForm);
      if (acctForm.getForwardAction() == null || acctForm.getForwardAction().length() < 1) {
        return mapping.findForward("success");
      }
		else {
        response.sendRedirect(acctForm.getForwardAction());
        return null;
      }
    }
  }
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:37,代码来源:SignonAction.java

示例14: referenceData

import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected Map<String, Object> referenceData(HttpServletRequest req) throws Exception {
    Map<String, Object> data = new HashMap<String, Object>();
    PagedListHolder<TriggerDescription> pagedListHolder = new PagedListHolder<TriggerDescription>(m_reportSchedulerService.getTriggerDescriptions());
    pagedListHolder.setPageSize(m_pageSize);
    int page = ServletRequestUtils.getIntParameter(req, "p", 0);
    pagedListHolder.setPage(page); 
    data.put("pagedListHolder", pagedListHolder);
    return data;

}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:13,代码来源:ManageReportScheduleController.java

示例15: handleRequestInternal

import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request,
                                             HttpServletResponse response) throws Exception {
    Map<ReportRepositoryDescription, PagedListHolder<DatabaseReportDescription>> repositoryList = new LinkedHashMap<ReportRepositoryDescription, PagedListHolder <DatabaseReportDescription>>();
    for (ReportRepositoryDescription reportRepositoryDescription : m_reportListService.getActiveRepositories()) {
        PagedListHolder<DatabaseReportDescription> pageListholder = new PagedListHolder<DatabaseReportDescription>(m_reportListService.getOnlineReportsByRepositoryId(reportRepositoryDescription.getId()));
        pageListholder.setPageSize(m_pageSize);
        int page = ServletRequestUtils.getIntParameter(request,"p_" + reportRepositoryDescription.getId(),0);
        pageListholder.setPage(page);
        repositoryList.put(reportRepositoryDescription, pageListholder);
    }
    return new ModelAndView("report/database/onlineList","repositoryList", repositoryList);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:15,代码来源:OnlineReportListController.java


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