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.web.struts.action.BaseAction; 11 import xpetstore.web.struts.action.item.ItemForm; 12 13 14 27 public class RemoveItemAction 28 extends BaseAction 29 { 30 32 35 protected ActionForward doExecute( ActionMapping mapping, 36 ActionForm form, 37 HttpServletRequest request, 38 HttpServletResponse response ) 39 throws Exception 40 { 41 ItemForm frm = ( ItemForm ) form; 42 String itemId = frm.getItemId( ); 43 44 getCart( request ).removeItem( itemId ); 45 46 return mapping.findForward( SUCCESS ); 47 } 48 } 49 | Popular Tags |