⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deleteemployeefromdeptaction.java

📁 是jsp开发与应用详解的全部源代码
💻 JAVA
字号:
package com.jspdev.ch18;

import org.apache.struts.action.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
 
public final class DeleteEmployeeFromDeptAction extends Action {

    public ActionForward execute(ActionMapping mapping,
                                 ActionForm form,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
        throws Exception {
        EmployeeBean service = new EmployeeBean();
        DynaActionForm f=(DynaActionForm)form;
        String employId=(String)f.get("employId");
        String deptId=(String)f.get("deptId");
		//String employId=request.getParameter("employId");
		//String deptId=request.getParameter("deptId");
        
        try {
             service.deleteEmployeeFromDept(employId,deptId);
             request.setAttribute("deptId",deptId);
            return (mapping.findForward("success"));
        }
        catch( Exception de ) {
            ActionErrors errors = new ActionErrors();
            ActionError error = new ActionError("error.employee.databaseException");
            errors.add( ActionErrors.GLOBAL_ERROR, error );
            saveErrors( request, errors );
            return (mapping.findForward("error"));
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -