资源简介

SSH整合购物车有上传浏览

资源截图

代码片段和文件信息

/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.hygj.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;
import org.apache.struts.actions.DispatchAction;

import com.hygj.bean.Products;
import com.hygj.dao.ProductDAO;
import com.jspsmart.upload.Request;
import com.jspsmart.upload.SmartUpload;
import com.jspsmart.upload.SmartUploadException;


public class ProductAction extends DispatchAction {
private ProductDAO productDAO;



public ProductDAO getProductDAO() {
return productDAO;
}



public void setProductDAO(ProductDAO productDAO) {
this.productDAO = productDAO;
}



public ActionForward init(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response) {
DynaActionForm productForm = (DynaActionForm) form;// TODO Auto-generated method stub

List list = productDAO.getList();

request.setAttribute(“list“ list);

return mapping.findForward(“list“);
}

public ActionForward add(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response) {
DynaActionForm productForm = (DynaActionForm) form;// TODO Auto-generated method stub

return mapping.findForward(“add“);
}
public ActionForward save(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response) {
DynaActionForm productForm = (DynaActionForm) form;// TODO Auto-generated method stub

Products product = (Products)productForm.get(“product“);

if(product.getId()>0){

productDAO.update(product);
}else{

productDAO.save(product);

}

return mapping.findForward(“init“);
}
public ActionForward update(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response) {
DynaActionForm productForm = (DynaActionForm) form;// TODO Auto-generated method stub

int id=Integer.parseInt(request.getParameter(“id“));
List list=productDAO.getList(id);
Products product = new Products();
if(list.size()>0){
product=(Products)list.get(0);
}
productForm.set(“product“product);
request.setAttribute(“product“ product);
return mapping.findForward(“add“);
}
public ActionForward delete(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response) {
DynaActionForm productForm = (DynaActionForm) form;// TODO Auto-generated method stub

int id=Integer.parseInt(request.getParameter(“id“));
List list=productDAO.getList(id);
Products product = new Products();
if(list.size()>0){
product=(Products)l

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-09-01 11:49  SSH整合购物车有上传浏览\DBoracle\
     文件       16384  2012-07-30 09:57  SSH整合购物车有上传浏览\DBoracle\data.dmp
     文件          27  2012-07-30 09:58  SSH整合购物车有上传浏览\DBoracle\用户名.txt
     目录           0  2012-09-01 11:49  SSH整合购物车有上传浏览\SSH\
     文件        5307  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\.classpath
     目录           0  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\.myeclipse\
     文件         531  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\.myhibernatedata
     文件         282  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\.mymetadata
     文件         240  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\.mystrutsdata
     文件        1902  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\.project
     文件         462  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\.springBeans
     目录           0  2012-09-01 11:49  SSH整合购物车有上传浏览\SSH\src\
     文件        2419  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\src\applicationContext.xml
     文件          63  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\src\ApplicationResources.properties
     目录           0  2012-09-01 11:49  SSH整合购物车有上传浏览\SSH\src\com\
     目录           0  2012-09-01 11:49  SSH整合购物车有上传浏览\SSH\src\com\hygj\
     目录           0  2012-09-01 11:49  SSH整合购物车有上传浏览\SSH\src\com\hygj\action\
     文件        3099  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\src\com\hygj\action\ProductAction.java
     文件        2404  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\src\com\hygj\action\UploadAction.java
     文件        1206  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\src\com\hygj\action\UsersAction.java
     目录           0  2012-09-01 11:49  SSH整合购物车有上传浏览\SSH\src\com\hygj\bean\
     文件        1204  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\src\com\hygj\bean\Products.hbm.xml
     文件        1292  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\src\com\hygj\bean\Products.java
     文件         818  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\src\com\hygj\bean\Users.hbm.xml
     文件         825  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\src\com\hygj\bean\Users.java
     目录           0  2012-09-01 11:49  SSH整合购物车有上传浏览\SSH\src\com\hygj\dao\
     文件        1168  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\src\com\hygj\dao\ProductDAO.java
     文件         550  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\src\com\hygj\dao\UsersDAO.java
     目录           0  2012-09-01 11:49  SSH整合购物车有上传浏览\SSH\src\com\hygj\filter\
     文件         761  2012-07-30 09:55  SSH整合购物车有上传浏览\SSH\src\com\hygj\filter\MyFilter.java
     目录           0  2012-09-01 11:49  SSH整合购物车有上传浏览\SSH\WebRoot\
............此处省略105个文件信息

评论

共有 条评论