📄 gyousyadeleteconfaction.java
字号:
//Created by MyEclipse Struts
// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.0.1/xslt/JavaClass.xsl
package com.dut.struts.action;
import java.sql.ResultSet;
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.dut.logic.db.Gyousya;
import com.dut.struts.form.GyousyaUpdateActionForm;
/**
* MyEclipse Struts
* Creation date: 04-12-2006
*
* XDoclet definition:
* @struts.action path="/gyousyaDeleteConf" name="gyousyaUpdateActionForm" input="/pages/GyousyaInput.jsp" scope="request" validate="true"
* @struts.action-forward name="ok" path="/pages/GyousyaSearch.jsp"
*/
public class GyousyaDeleteConfAction extends Action {
// --------------------------------------------------------- Instance Variables
// --------------------------------------------------------- Methods
/**
* Method execute
* 对"契約業者情報登録/検索"的"はい"和"いいえ"按钮做方法调用和转页
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
* @author 赵倩 04-12-2006
*/
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
GyousyaUpdateActionForm gyousyaUpdateActionForm = (GyousyaUpdateActionForm) form;
// TODO Auto-generated method stub
Gyousya aa=new Gyousya();
ActionForward forward=null;
/**得到GyousyaDeleteConf.jsp中传来的参数,以区别点的哪个按钮*/
String two=request.getParameter("two");
//request.getSession().removeAttribute("list");
/**当按下的按钮是"はい"时*/
if(two.equals("shi")){
/**得到GyousyaDeleteConf.jsp中用hidden传的数据,这样传的数据要用form中的set,get传值*/
String message=gyousyaUpdateActionForm.getMessage();
try{
/**以message为条件删除数据库中的符合条件的数据*/
aa.deleteMess(Integer.parseInt(message));
/**因为要求中删除数据后要返回"契約業者情報検索結果一覧"显示所有数据,以免按"qiID","qiName"查询显示,所以要移除压在SESSION中的"qiID","qiName"*/
request.getSession().removeAttribute("qiID");
request.getSession().removeAttribute("qiName");
/**把要进入的第几页压在session中*/
request.getSession().setAttribute("from","1");
/**转页*/
ActionForward forward3=mapping.findForward("jiansuo");
forward=forward3;
}
catch(Exception e9){
System.out.println("Method deleteMess is error e9"+e9);
}
}
/**当按下的按钮是"いいえ"时*/
if(two.equals("fou")){
try{
/**把要进入的第几页压在session中*/
request.getSession().setAttribute("from","1");
/**转页*/
ActionForward forward2=mapping.findForward("jiansuo");
forward=forward2;
}
catch(Exception e7){
System.out.println("Method deleteMess is error e7"+e7);
}
}
return forward;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -