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

📄 loginform.java

📁 泽风留言本,非常小巧好用的东西啊.请多多照顾.
💻 JAVA
字号:
/**
 *  作者: 佟劲纬   创建日期: 2006-1-10
 *	
 *	QQ: 532443423 Email: TJW_7@163.com
 */
package com.tjw.guestbook.form;

import org.apache.struts.action.*;
import javax.servlet.http.*;

/**
 * 
 */
public final class LoginForm extends ActionForm {

	private String url = null;
	
	private String userName = null;

	private String password = null;

	public void setUrl(String url) {
		this.url = url;
	}
	
	public String getUrl() {
		return this.url;
	}
	
	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserName() {
		return this.userName;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPassword() {
		return this.password;
	}

	public void reset(ActionMapping mapping, HttpServletRequest request) {
		this.userName = null;
		this.password = null;
		this.url = null;
	}

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

		if (userName == null || userName.length() <= 0) {
			errors.add("userNameError", new ActionMessage("error.name.null"));
		} else if (userName.length() <= 2) {
			errors.add("userNameError", new ActionMessage("error.name.small"));
		}

		if (password == null || password.length() <= 0) {
			errors.add("passwordError", new ActionMessage(
							"error.password.null"));
		} else if (password.length() <= 5) {
			errors.add("passwordError", new ActionMessage(
					"error.password.small"));
		}

		return errors;
	}

}

⌨️ 快捷键说明

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