protected org.apache.struts.action.ActionForward | doExecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
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 );
|