FileDocCategorySizeDatePackage
CheckoutAction.javaAPI DocJBoss 4.2.11829Fri Jul 13 20:56:04 BST 2007xpetstore.web.struts.action.cart

CheckoutAction

public class CheckoutAction extends xpetstore.web.struts.action.BaseAction
author
Herve Tchepannou
struts.action
name="cartForm" path="/checkout" scope="request" validate="false"
struts.action-forward
name="success" path="/checkout.jsp"

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

see
xpetstore.web.struts.action.BaseAction#doExecute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)

        String    userId = ( String ) request.getSession(  ).getAttribute( USERID_KEY );
        CartForm  frm = ( CartForm ) form;
        Cart cart = getCart( request );

        /* Order */
        Customer cust = getPetstore(  ).getCustomer( userId );
        frm.setCustomer( cust );

        /* Cart items */
        Collection items = cart.getCartItems(  );
        frm.setCartItems( items );

        /* Total */
        frm.setTotal( cart.getTotal(  ) );

        return mapping.findForward( SUCCESS );