professioninfoaction.java

来自「为基于J2EE(Java2 Platform」· Java 代码 · 共 51 行

JAVA
51
字号
//Created by MyEclipse Struts// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.0.1/xslt/JavaClass.xslpackage com.huang.actions;import java.util.ArrayList;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 com.huang.common.DB.DBtool;import com.huang.forms.ProfessionInfoForm;public class ProfessionInfoAction extends Action {	public ActionForward execute(		ActionMapping mapping,		ActionForm form,		HttpServletRequest request,		HttpServletResponse response) {		ProfessionInfoForm professionInfoForm = (ProfessionInfoForm) form;				String index = (String)request.getParameter("index");							if(index.equals("delete")) {			//删除时			String profession_id = (String)request.getParameter("id");			String sql = "delete from tb_profession where profession_id='"+profession_id+"'";			DBtool.updateData(sql);		}else if(index.equals("update")) {			//修改时		}				ArrayList profession_list = DBtool.getDataList("tb_profession",new String[]{"profession_id","profession_name","dept_id"}); 		request.setAttribute("profession",profession_list);		ArrayList dept_list = DBtool.getDataList("tb_dept",new String[]{"dept_id","dept_name"}); 			request.setAttribute("dept",dept_list);		return mapping.findForward("success");	}}

⌨️ 快捷键说明

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