Package org.springframework.samples.jpetstore.domain

Examples of org.springframework.samples.jpetstore.domain.Product


    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();
      }
      else if ("previous".equals(page)) {
View Full Code Here


  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();
      }
      else if ("previous".equals(page)) {
View Full Code Here

TOP

Related Classes of org.springframework.samples.jpetstore.domain.Product

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.