⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loginform.java

📁 《jsp网络编程技术与实例》
💻 JAVA
字号:
//Created by MyEclipse Struts// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.8.4/xslt/JavaClass.xslpackage com.yourcompany.struts.form;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: 04-18-2005 *  * XDoclet definition: * @struts:form name="loginForm" */public class LoginForm extends ActionForm {	// --------------------------------------------------------- Instance Variables	/** password property */	private String password;	/** userName property */	private String userName;	// --------------------------------------------------------- Methods	/** 	 * Method validate	 * @param mapping	 * @param request	 * @return ActionErrors	 */	public ActionErrors validate(		ActionMapping mapping,		HttpServletRequest request) {		ActionErrors errors = new ActionErrors();		if (userName == null || userName.length() < 1)		{			errors.add("userName", new ActionError("login.jsp.no.name.error"));		}		if (password == null || password.length() < 1)		{			errors.add("password", new ActionError("login.jsp.no.password.error"));		}		return errors;	}	/** 	 * Method reset	 * @param mapping	 * @param request	 */	public void reset(ActionMapping mapping, HttpServletRequest request) {		userName = null;		password = null;	}	/** 	 * 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;	}	/** 	 * Returns the userName.	 * @return String	 */	public String getUserName() {		return userName;	}	/** 	 * Set the userName.	 * @param userName The userName to set	 */	public void setUserName(String userName) {		this.userName = userName;	}}

⌨️ 快捷键说明

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