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

CartAction

public class CartAction extends xpetstore.web.struts.action.BaseAction
author
Herve Tchepannou
struts.action
name="cartForm" path="/cart" scope="request" validate="false"
struts.action-forward
name="success" path="/cart.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)

        CartForm  frm = ( CartForm ) form;

        Cart cart = getCart( request );

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

        /* Total */
        double total = cart.getTotal(  );
        frm.setTotal( total );

        return mapping.findForward( SUCCESS );