📄 usersloginform.java
字号:
package com.oxliu.formbean;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
public class UsersLoginForm extends ActionForm {
private String user_Name;
private String user_Pwd;
public String getUser_Name() {
return user_Name;
}
public void setUser_Name(String user_Name) {
this.user_Name = user_Name;
}
public String getUser_Pwd() {
return user_Pwd;
}
public void setUser_Pwd(String user_Pwd) {
this.user_Pwd = user_Pwd;
}
/*
* 方法:validate(ActionMapping mapping,HttpServletRequest request)
* 功能:用户登录信息不为空验证,返回error
*/
public ActionErrors validate(ActionMapping mapping,HttpServletRequest request){
ActionErrors err=new ActionErrors();
if(this.getUser_Name()==null || this.getUser_Name().length()<=1){
//err.add("nameerr", new ActionMessage("err.user.login.namenullerr"));
err.add("nameerror", new ActionMessage("err.user.login.namenullerr"));
}
if(this.getUser_Pwd()==null || this.getUser_Pwd().length()<1){
err.add("passworderror", new ActionMessage("err.user.login.pwdnullerror"));
}
return err;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -