kspxaction.java
来自「sql+struts+jsp 提供考试的一般需求」· Java 代码 · 共 43 行
JAVA
43 行
package ks;
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 org.apache.struts.action.Action;
import org.apache.struts.actions.LookupDispatchAction;
import javax.sql.DataSource;
import java.util.Map;
import java.util.HashMap;
import javax.sql.*;
public class kspxAction extends LookupDispatchAction {
public ActionForward insert(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception{
kspxForm fm = (kspxForm) form;
DataSource ds=this.getDataSource(request,"DS");
String stuno=fm.getStuno();
String name=fm.getName();
String sex=fm.getSex();
String idnum=fm.getIdnum();
String subject=fm.getSubject();
String distin=fm.getDistin();
String phone=fm.getPhone();
checkBean in=new checkBean(ds);
in.insert(stuno,name,sex,idnum,subject,distin,phone);
request.setAttribute("baoming",fm);
return mapping.findForward("pxinfo");
}
protected Map getKeyMethodMap() {
Map map=new HashMap();
map.put("button.submit","insert");
return map;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?