loginform.java
来自「本人制作的运用Struts技术的联系项目 员工管理系统」· Java 代码 · 共 101 行
JAVA
101 行
//Created by MyEclipse Struts// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.1.1/xslt/JavaClass.xslpackage com.my.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: 08-02-2006 * * XDoclet definition: * * @struts.form name="loginForm" */public class LoginForm extends ActionForm { // --------------------------------------------------------- Instance // Variables /** * */ private static final long serialVersionUID = 8277529315557070377L; /** 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.equals("")) { System.out.println(username+"@"); errors.add("username", new ActionError("error.regist.name.required")); } else { if (password == null || password.equals("")) { errors.add("password", new ActionError( "error.regist.psw.required")); } } return errors; } /** * 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 + =
减小字号Ctrl + -
显示快捷键?