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

📄 userforgetpasswordform.java

📁 《基于Eclipse的开源框架技术与实战》[第10章]随书源码
💻 JAVA
字号:
package com.free.web.struts.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.*;

/**
 * <p>Title: Eclipse Plugin Development</p>
 * <p>Description: Free download</p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: Free</p>
 * @author gan.shu.man
 * @version 1.0
 */

public class UserForgetPasswordForm extends ActionForm {

	private String action = "add";

	private String username = null;

	private String email = null;

	public void setAction(String action) {
		this.action = action;
	}

	public String getAction() {
		return this.action;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getUsername() {
		return this.username;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getEmail() {
		return this.email;
	}

	public void reset(ActionMapping mapping, HttpServletRequest request) {

		this.username = null;
		this.email = null;

		this.action = "add";

	}

	public ActionErrors validate(

	ActionMapping mapping, HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();

		if ((getUsername() == null || getUsername().length() < 1)
				&& (getEmail() == null || getEmail().length() < 1)) {
			errors.add("username", new ActionMessage(
					"error.username/email.required"));
		}

		return errors;
	}

}

⌨️ 快捷键说明

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