📄 adminlogonform.java
字号:
package com.elan.forum.forms;
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;
import com.elan.forum.util.Constents;
import com.elan.forum.util.ElCheckString;
public class AdminLogonForm extends ActionForm{
String username ;
String password;
String checkCode;
@Override
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
this.username = null;
this.password = null;
this.checkCode = 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 String getCheckCode() {
return checkCode;
}
public void setCheckCode(String checkCode) {
this.checkCode = checkCode;
}
@Override
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// TODO Auto-generated method stub
ActionErrors errors = new ActionErrors();
if(ElCheckString.isEmptyString(username)) {
errors.add("usernamenull", new ActionMessage("username.not.null"));
if(ElCheckString.isEmptyString(password)) {
errors.add("passwordnull", new ActionMessage("password.not.null"));
}
}else if(ElCheckString.isEmptyString(password)) {
errors.add("passwordnull", new ActionMessage("password.not.null"));
}
///验证码验证
return errors;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -