📄 passwordhintform.java
字号:
package org.redsoft.forum.web;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;/** * Form bean for email hints * <ul> * <li><b>username</b> - Entered the user registered name * </ul> * * @author Johon Liu * @pair watcher Waltson Tao * @version 1.0 May 04,2002 */public class PasswordHintForm extends ActionForm{ // the name entered by user who want to get his/her email private String userName = null; private String email = null; // setter method public void setUserName(String userName) { this.userName = userName; } // getter method public String getUserName() { return userName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } /** * Reset all properties to their default values. * * @param mapping The mapping used to select this instance * @param request The servlet request we are processing */ public void reset(ActionMapping mapping, HttpServletRequest request) { this.userName = null; this.email = null; } /** * Validate the properties that have been set from this HTTP request, * and return an <code>ActionErrors</code> object that encapsulates any * validation errors that have been found. If no errors are found, return * <code>null</code> or an <code>ActionErrors</code> object with no * recorded error messages. * * @param mapping The mapping used to select this instance * @param request The servlet request we are processing */ public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if ( userName == null || userName.length() == 0 ){ errors.add("user name", new ActionError("error.userName.required") ); } if ( email == null || email.length() == 0 ) { errors.add("email", new ActionError("error.email.required") ); } return errors; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -