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

📄 logonform.java

📁 JSP+Struts+Hibernate进行网络开发的一个实例
💻 JAVA
字号:
package cn.com.zzb.eshopping.logon;
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 static final long serialVersionUID = 1L;
    private String username = null;
	private String password = null;
	private String chkma = null;
	private String rand = null;
	
	public void setUsername(String username){
		this.username = username;
	}
	public String getUsername(){
		return username;
	}
	
	public void setPassword(String password){
		this.password = password;
	}
	public String getPassword(){
		return password;
	}
	
	public void setChkma(String chkma)
	{
		this.chkma = chkma;
	}
	public String getChkma()
	{
		return chkma;
	}
	//
	public ActionErrors validate(ActionMapping mapping,HttpServletRequest request){
		ActionErrors errors = new ActionErrors();
		if((username==null)||(username.length()<1))
		{
			ActionError error= new ActionError("error.username.required");
			errors.add("username",error);
		}
		if((password==null)||(password.length()<6))
		{
			ActionError error= new ActionError("error.password.required");
			errors.add("password",error);			
		}	
		if((chkma==null)||(chkma.length()!=4))
		{
			ActionError error= new ActionError("error.chkma.required");
			errors.add("chkma",error);			
		}
		return errors;		
	}
}

⌨️ 快捷键说明

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