📄 glyfpaction.java
字号:
// Created by Xslt generator for Eclipse.// XSL : not found (java.io.FileNotFoundException: (Bad file descriptor))// Default XSL used : easystruts.jar$org.easystruts.xslgen.JavaClass.xslpackage struts.action;import java.sql.ResultSet;import java.sql.SQLException;import javabean.dbconnect;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 struts.form.GlyfpForm;public class GlyfpAction extends Action { // --------------------------------------------------------- Instance Variables // --------------------------------------------------------- Methods public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { GlyfpForm glyfpForm = (GlyfpForm) form; String uuid=glyfpForm.getuuid().trim(); String pwd1=glyfpForm.getpwd1().trim(); String pwd2=glyfpForm.getpwd2().trim(); String rname=glyfpForm.getrname().trim(); rname=new String(rname.getBytes("ISO-8859-1")); String sex=glyfpForm.getsex(); sex=new String(sex.getBytes("ISO-8859-1")); String email=glyfpForm.getemail(); String phone=glyfpForm.getphone(); String flag=glyfpForm.getflag(); int id=0,number=0; //ActionMessages errors=new ActionMessages(); String sql=""; ResultSet rs=null; dbconnect db=new dbconnect(); sql="select * from manager where uuid='"+uuid+"'"; rs=db.executeQuery(sql); try { while(rs.next()) { number++; } rs.close(); } catch(SQLException e){ return null; } if(number>0) { //errors.add("uuids",new ActionMessage("uuids.error")); //saveErrors(request,(ActionErrors) errors); return (new ActionForward(mapping.getInput())); } if(!pwd1.equals(pwd2)) { //errors.add("pwd",new ActionMessage("pwd.error")); //saveErrors(request,(ActionErrors) errors); return (new ActionForward(mapping.getInput())); } sql="select max(id) as id from MANAGER"; rs=db.executeQuery(sql); if(rs.next()) { id=rs.getInt("id"); } id=id+1; rs.close(); sql="insert into manager values('"+id+"','"+uuid+"','"+pwd1+"','"+email+"','"+rname+"','"+sex+"','"+phone+"','"+flag+"')"; rs=db.executeQuery(sql); rs.close(); return mapping.findForward("BackSuccess"); //throw new UnsupportedOperationException("Generated method 'execute(...)' not implemented."); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -