• 大小: 10.9M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-04
  • 语言: Java
  • 标签: 其他  

资源简介

sztj_javaweb_07.zip

资源截图

代码片段和文件信息

package com.action;

import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForward;
import com.actionForm.BranchForm;
import org.apache.struts.action.Action;
import com.dao.BranchDAO;

public class Branch extends Action {
    BranchDAO branchDAO=null;
    public Branch() {
        branchDAO = new BranchDAO();
    }
    public ActionForward execute(ActionMapping mapping ActionForm form
                                 HttpServletRequest request
                                 HttpServletResponse response) {
        BranchForm branchForm = (BranchForm) form;
            String action=request.getParameter(“action“);
            if(action.equals(““) || action==null){
                request.setAttribute(“err““您的操作有误!“);
                return mapping.findForward(“error“);
            }else if(action.equals(“branchQuery“)){
                return branchQuery(mappingformrequestresponse);
            }else if(action.equals(“branchdel“)){
                return branchDel(mapping form request response);
            }else if(action.equals(“branchadd“)){
                return branchAdd(mapping form request response);
            }
            return mapping.findForward(“error“);
        }

        public ActionForward branchQuery(ActionMapping mapping ActionForm form
                                     HttpServletRequest request
                                     HttpServletResponse response) {
            String str = ““;
            request.setAttribute(“branchList“ branchDAO.query(str));
            return mapping.findForward(“branchQuery“);
        }
        public ActionForward branchDel(ActionMapping mapping ActionForm form
                                     HttpServletRequest request
                                     HttpServletResponse response) {
            int id=Integer.parseInt(request.getParameter(“id“));
            int rtn=branchDAO.del(id);
            if(rtn==0){
                request.setAttribute(“error““该部门信息不能删除!“);
                return mapping.findForward(“error“);
            }else{
                return mapping.findForward(“branchdelok“);
            }
        }
        public ActionForward branchAdd(ActionMapping mapping ActionForm form
                                    HttpServletRequest request
                                    HttpServletResponse response) {
           BranchForm branchForm = (BranchForm) form;
           int rtn=branchDAO.insert(branchForm);
           if(rtn==2){
               request.setAttribute(“error““该部门信息已经存在!“);
               return mapping.findForward(“error“);
           }else if(rtn==1){
               return mapping.findForward(“branchaddok“);
           }else{
               request.setAttribute(“error““部门信息添加失败!“);
        

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-12-07 09:22  sztj_javaweb_07\
     文件        2229  2015-04-02 16:21  sztj_javaweb_07\.classpath
     目录           0  2015-04-02 16:18  sztj_javaweb_07\.myeclipse\
     文件         279  2011-03-02 09:27  sztj_javaweb_07\.mymetadata
     文件        1408  2011-02-25 16:36  sztj_javaweb_07\.project
     目录           0  2018-12-07 09:13  sztj_javaweb_07\.settings\
     文件         500  2011-02-25 16:17  sztj_javaweb_07\.settings\.jsdtscope
     文件         330  2011-02-25 16:17  sztj_javaweb_07\.settings\org.eclipse.jdt.core.prefs
     文件          49  2011-02-25 16:17  sztj_javaweb_07\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2011-02-25 16:17  sztj_javaweb_07\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2018-12-07 09:13  sztj_javaweb_07\src\
     文件           0  2007-03-10 15:43  sztj_javaweb_07\src\ApplicationResources.properties
     目录           0  2018-12-07 09:13  sztj_javaweb_07\src\com\
     目录           0  2018-12-07 09:22  sztj_javaweb_07\src\com\action\
     目录           0  2018-12-07 09:23  sztj_javaweb_07\src\com\actionForm\
     文件         864  2007-03-10 15:43  sztj_javaweb_07\src\com\actionForm\BranchForm.hbm.xml
     文件        1131  2007-03-10 15:43  sztj_javaweb_07\src\com\actionForm\BranchForm.java
     文件         465  2007-03-10 15:43  sztj_javaweb_07\src\com\actionForm\CheckForm.hbm.xml
     文件         631  2007-03-10 15:43  sztj_javaweb_07\src\com\actionForm\CheckForm.java
     文件        1082  2007-03-10 15:43  sztj_javaweb_07\src\com\actionForm\DamageForm.hbm.xml
     文件        1959  2007-03-10 15:43  sztj_javaweb_07\src\com\actionForm\DamageForm.java
     文件        1069  2007-03-10 15:43  sztj_javaweb_07\src\com\actionForm\GetUseForm.hbm.xml
     文件        1927  2007-03-10 15:43  sztj_javaweb_07\src\com\actionForm\GetUseForm.java
     文件        1415  2007-03-10 15:43  sztj_javaweb_07\src\com\actionForm\GoodsForm.hbm.xml
     文件        2065  2007-03-10 15:43  sztj_javaweb_07\src\com\actionForm\GoodsForm.java
     文件        1130  2007-03-10 15:43  sztj_javaweb_07\src\com\actionForm\IfForm.java
     文件         626  2007-03-10 15:43  sztj_javaweb_07\src\com\actionForm\InStorageForm.hbm.xml
     文件        1006  2007-03-10 15:43  sztj_javaweb_07\src\com\actionForm\InStorageForm.java
     文件        3108  2007-03-10 15:43  sztj_javaweb_07\src\com\action\Branch.java
     文件        2460  2007-03-10 15:43  sztj_javaweb_07\src\com\action\Cart.java
     文件        2679  2007-03-10 15:43  sztj_javaweb_07\src\com\action\Damage.java
............此处省略181个文件信息

评论

共有 条评论