Spring Framework PagedListHolder - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework PagedListHolder class.

This code example shows how to use the following methods:setPageSize
public class ViewProductAction extends BaseAction { 
 
  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    String productId = request.getParameter("productId");
    if (productId != null) {
			PagedListHolder itemList = new PagedListHolder(getPetStore().getItemListByProduct(productId));
			itemList.setPageSize(4);
			Product product = getPetStore().getProduct(productId);
      request.getSession().setAttribute("ViewProductAction_itemList", itemList);
			request.getSession().setAttribute("ViewProductAction_product", product);
			request.setAttribute("itemList", itemList);
      request.setAttribute("product", product);
    } 
		else { 
			PagedListHolder itemList = (PagedListHolder) request.getSession().getAttribute("ViewProductAction_itemList");
			Product product = (Product) request.getSession().getAttribute("ViewProductAction_product");
      String page = request.getParameter("page");
      if ("next".equals(page)) {
        itemList.nextPage();
      } 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setPageSize
 
  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    String categoryId = request.getParameter("categoryId");
    if (categoryId != null) {
			Category category = getPetStore().getCategory(categoryId);
      PagedListHolder productList = new PagedListHolder(getPetStore().getProductListByCategory(categoryId));
			productList.setPageSize(4);
			request.getSession().setAttribute("ViewProductAction_category", category);
			request.getSession().setAttribute("ViewProductAction_productList", productList);
			request.setAttribute("category", category);
			request.setAttribute("productList", productList);
    } 
		else { 
			Category category = (Category) request.getSession().getAttribute("ViewProductAction_category");
			PagedListHolder productList = (PagedListHolder) request.getSession().getAttribute("ViewProductAction_productList");
			if (category == null || productList == null) {
				throw new IllegalStateException("Cannot find pre-loaded category and product list");
			} 
      String page = request.getParameter("page");
      if ("next".equals(page)) {
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setPageSize
		if (keyword != null) {
			if (!StringUtils.hasLength(keyword)) {
				request.setAttribute("message", "Please enter a keyword to search for, then press the search button.");
				return mapping.findForward("failure");
			} 
			PagedListHolder productList = new PagedListHolder(getPetStore().searchProductList(keyword.toLowerCase()));
			productList.setPageSize(4);
			request.getSession().setAttribute("SearchProductsAction_productList", productList);
			request.setAttribute("productList", productList);
			return mapping.findForward("success");
		} 
		else { 
      String page = request.getParameter("page");
      PagedListHolder productList = (PagedListHolder) request.getSession().getAttribute("SearchProductsAction_productList");
			if (productList == null) {
				request.setAttribute("message", "Your session has timed out. Please start over again.");
				return mapping.findForward("failure");
			} 
			if ("next".equals(page)) {
				productList.nextPage();
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setPageSize
 
	public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { 
		Map model = new HashMap(); 
		String productId = request.getParameter("productId"); 
		if (productId != null) { 
			PagedListHolder itemList = new PagedListHolder(this.petStore.getItemListByProduct(productId)); 
			itemList.setPageSize(4); 
			Product product = this.petStore.getProduct(productId); 
			request.getSession().setAttribute("ViewProductAction_itemList", itemList); 
			request.getSession().setAttribute("ViewProductAction_product", product); 
			model.put("itemList", itemList); 
			model.put("product", product); 
		} 
		else { 
			PagedListHolder itemList = (PagedListHolder) request.getSession().getAttribute("ViewProductAction_itemList"); 
			Product product = (Product) request.getSession().getAttribute("ViewProductAction_product"); 
			String page = request.getParameter("page"); 
			if ("next".equals(page)) { 
				itemList.nextPage(); 
			} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setPageSize
	public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { 
		Map model = new HashMap(); 
		String categoryId = request.getParameter("categoryId"); 
		if (categoryId != null) { 
			Category category = this.petStore.getCategory(categoryId); 
			PagedListHolder productList = new PagedListHolder(this.petStore.getProductListByCategory(categoryId)); 
			productList.setPageSize(4); 
			request.getSession().setAttribute("ViewProductAction_category", category); 
			request.getSession().setAttribute("ViewProductAction_productList", productList); 
			model.put("category", category); 
			model.put("productList", productList); 
		} 
		else { 
			Category category = (Category) request.getSession().getAttribute("ViewProductAction_category"); 
			PagedListHolder productList = (PagedListHolder) request.getSession().getAttribute("ViewProductAction_productList"); 
			if (category == null || productList == null) { 
				throw new IllegalStateException("Cannot find pre-loaded category and product list"); 
			} 
			String page = request.getParameter("page"); 
			if ("next".equals(page)) { 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setPageSize
		String keyword = request.getParameter("keyword"); 
		if (keyword != null) { 
			if (!StringUtils.hasLength(keyword)) { 
				return new ModelAndView("Error", "message", "Please enter a keyword to search for, then press the search button."); 
			} 
			PagedListHolder productList = new PagedListHolder(this.petStore.searchProductList(keyword.toLowerCase())); 
			productList.setPageSize(4); 
			request.getSession().setAttribute("SearchProductsController_productList", productList); 
			return new ModelAndView("SearchProducts", "productList", productList); 
		} 
		else { 
			String page = request.getParameter("page"); 
			PagedListHolder productList = (PagedListHolder) request.getSession().getAttribute("SearchProductsController_productList"); 
			if (productList == null) { 
				return new ModelAndView("Error", "message", "Your session has timed out. Please start over again."); 
			} 
			if ("next".equals(page)) { 
				productList.nextPage(); 
			} 
			else if ("previous".equals(page)) { 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setPageSize
		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"); 
			} 
		} 
	} 
 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setPageSize
			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");
		} 
  } 
 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setPageSize
			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");
		} 
  } 
 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setPageSize
					"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); 
	} 
 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Spring Framework PagedListHolder Methods: