FileDocCategorySizeDatePackage
ViewCartAction.javaAPI DocExample1221Thu Dec 04 08:19:26 GMT 2003org.springframework.samples.jpetstore.web.struts

ViewCartAction

public class ViewCartAction extends BaseAction

Fields Summary
Constructors Summary
Methods Summary
public org.apache.struts.action.ActionForwardexecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

    CartActionForm cartForm = (CartActionForm) form;
    AccountActionForm acctForm = (AccountActionForm) request.getSession().getAttribute("accountForm");
    String page = request.getParameter("page");
    if (acctForm != null && acctForm.getAccount() != null) {
      if ("next".equals(page)) {
        acctForm.getMyList().nextPage();
      }
			else if ("previous".equals(page)) {
        acctForm.getMyList().previousPage();
      }
    }
    if ("nextCart".equals(page)) {
      cartForm.getCart().getCartItemList().nextPage();
    }
		else if ("previousCart".equals(page)) {
      cartForm.getCart().getCartItemList().previousPage();
    }
    return mapping.findForward("success");