?? empdelaction.java
字號:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.yiboit.hhs.action;
import java.sql.SQLException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import com.yiboit.hhs.daos.EmpDelDAO;
/**
* MyEclipse Struts
* Creation date: 06-12-2008
*
* XDoclet definition:
* @struts.action validate="true"
* @struts.action-forward name="success" path="/empList.do" redirect="true"
*/
public class EmpDelAction extends Action {
/*
* Generated Methods
*/
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
EmpDelDAO dao = null;
try {
dao = new EmpDelDAO(this.getDataSource(request, "ora"));
String empId = request.getParameter("id");
dao.setEmpId(empId);
dao.databaseAccess();
if (dao.isResult()) {
return mapping.findForward("success");
} else {
ActionErrors errors = new ActionErrors();
errors.add("asdf", new ActionMessage("emp.del.failure"));
this.addErrors(request, errors);
return mapping.findForward("failure");
}
} catch (SQLException e) {
e.printStackTrace();
return mapping.findForward("error");
} finally {
dao.close();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -