logonform.java

来自「struts+hibernate BBS mysql数据库 功能基本齐全」· Java 代码 · 共 47 行

JAVA
47
字号
package com.elan.forum.formBean;

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;

public class LogonForm extends ActionForm{
	private String username = null;
	private String password = null;
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	/*public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		if(isEmptyStr(username)) {
			errors.add("userlogonerr", new ActionError("username.not.null"));
			if(isEmptyStr(password)) {
				errors.add("userlogonerr", new ActionError("username.password.not.null"));
			}
		} else if(isEmptyStr(password)){
			errors.add("userlogonerr", new ActionError("password.not.null"));
		}
		return errors;
	}

	private boolean isEmptyStr(String string) {
		if(null == string) return true;
		if ("".equals(string.trim()) || 0 == string.length()) {
			return true;
		}
		return false;
	}*/
}

⌨️ 快捷键说明

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