loginform.java

来自「1 系统简介 1.1 系统名称:bugtrail 1.2 适用范围:大型或小」· Java 代码 · 共 91 行

JAVA
91
字号
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package bugtrail.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.*;

/** 
 * MyEclipse Struts
 * Creation date: 12-19-2006
 * 
 * XDoclet definition:
 * @struts.form name="LoginForm"
 */
public class LoginForm extends ActionForm {
	/*
	 * Generated fields
	 */

	/** staffID property */
	private String staffID;

	/** password property */
	private String password;

	/*
	 * Generated Methods
	 */


	/** 
	 * Method reset
	 * @param mapping
	 * @param request
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		// TODO Auto-generated method stub
	}

	/** 
	 * Returns the staffID.
	 * @return String
	 */
	public String getStaffID() {
		return staffID;
	}

	/** 
	 * Set the staffID.
	 * @param staffID The staffID to set
	 */
	public void setStaffID(String staffID) {
		this.staffID = staffID;
	}

	/** 
	 * Returns the password.
	 * @return String
	 */
	public String getPassword() {
		return password;
	}

	/** 
	 * Set the password.
	 * @param password The password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/** 
	 * Method validate
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	@SuppressWarnings({ "deprecation"})
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		if(getStaffID().length()<1||!getStaffID().matches("\\d+"))
			errors.add("staffID",new ActionError("id.error"));
		if(getPassword().length()<1)
			errors.add("password",new ActionError("password.null"));
		return errors;
	}
}

⌨️ 快捷键说明

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