📄 userlandingactionfrom.java
字号:
package com.bluedot.bank.framework.web.actionform;
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 UserLandingActionFrom extends ActionForm {
/**
*
*/
private static final long serialVersionUID = 1L;
private String userName;
private String pwd;
private String command;
public String getCommand() {
return command;
}
public void setCommand(String command) {
this.command = command;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPwd() {
return pwd;
}
public void setPwd(String pwd) {
this.pwd = pwd;
}
@Override
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// 登陆用户名和密码的效验
ActionErrors actionErrors = new ActionErrors();
if (this.userName == null || this.userName.trim().isEmpty()) {
actionErrors.add("userName", new ActionMessage(
"error.name.required"));
}
if (this.pwd == null || this.pwd.trim().isEmpty()) {
actionErrors.add("pwd", new ActionMessage("error.password.rep"));
}
return actionErrors;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -