1 package xpetstore.web.struts.action.cart; 2 3 import javax.servlet.http.HttpServletRequest ; 4 import javax.servlet.http.HttpServletResponse ; 5 6 import org.apache.struts.action.ActionForm; 7 import org.apache.struts.action.ActionForward; 8 import org.apache.struts.action.ActionMapping; 9 10 import xpetstore.services.cart.ejb.Cart; 11 12 import xpetstore.web.struts.action.BaseAction; 13 14 15 28 public class UpdateCartAction 29 extends BaseAction 30 { 31 33 36 protected ActionForward doExecute( ActionMapping mapping, 37 ActionForm form, 38 HttpServletRequest request, 39 HttpServletResponse response ) 40 throws Exception 41 { 42 CartForm frm = ( CartForm ) form; 43 44 Cart cart = getCart( request ); 45 46 47 cart.updateItems( frm.getItemId( ), frm.getQuantity( ) ); 48 49 return mapping.findForward( SUCCESS ); 50 } 51 } 52 | Popular Tags |