loginform.java

来自「数学网」· Java 代码 · 共 97 行

JAVA
97
字号
//Created by MyEclipse Struts// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.0.1/xslt/JavaClass.xslpackage math.login.controller;import javax.servlet.http.HttpServletRequest;import org.apache.struts.action.ActionError;import org.apache.struts.action.ActionErrors;import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionMapping;/**  * MyEclipse Struts * Creation date: 11-03-2006 *  * XDoclet definition: * @struts.form name="loginForm" */public class LoginForm extends ActionForm {	// --------------------------------------------------------- Instance Variables	// --------------------------------------------------------- Methods	/** 	 * Method validate	 * @param mapping	 * @param request	 * @return ActionErrors	 */	private String username;	private String password;	//private int users_grade;	private String rand;		public ActionErrors validate(		ActionMapping mapping,		HttpServletRequest request) {		ActionErrors errors = new ActionErrors();	    if ( (username == null) || (username.length() < 1))	      errors.add("username", new ActionError("error.username.required"));	    	    else if ( (password == null) || (password.length() < 1))	      errors.add("password", new ActionError("error.password.required"));	   // else if ( ( users_grade!= 1) &&( users_grade!= 2) )		     // errors.add("users_grade", new ActionError("error.users_grade.required"));		// TODO Auto-generated method stub		return errors;		// TODO Auto-generated method stub	}	/** 	 * Method reset	 * @param mapping	 * @param request	 */	public void reset(ActionMapping mapping, HttpServletRequest request) {	}	/*public int getUsers_grade() {	//	return users_grade;	}	public void setUsers_grade(int users_grade) {		this.users_grade = users_grade;	}*/	public String getPassword() {		return password;	}	public void setPassword(String password) {		this.password = password;	}	public String getUsername() {		return username;	}	public void setUsername(String username) {		this.username = username;	}	public String getRand() {		return rand;	}	public void setRand(String rand) {		this.rand = rand;	}}

⌨️ 快捷键说明

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