cartsumaction.java
来自「struts1 hibernate3 电子购物商城源码 加上了ANT编译.」· Java 代码 · 共 39 行
JAVA
39 行
package dream.ourshopping.struts.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.validator.DynaValidatorForm;
import dream.ourshopping.domain.Member;
import dream.ourshopping.persistence.ShopcartDAO;
public class CartsumAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
DynaValidatorForm dv = (DynaValidatorForm) form;
String bool = (String) dv.get("num");
ShopcartDAO sd = new ShopcartDAO();
sd.delete(new Integer(bool));
Member mb = (Member) request.getSession().getAttribute("user");
List list = sd.findByUserid(mb.getId());
request.getSession().setAttribute("prodlist", list);
request.getSession().setAttribute("body", "/shopcart/carinfor.jsp");
return mapping.findForward("sucessful");
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?