?? registerform.java
字號(hào):
package com.wiely.struts.form;
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;
@SuppressWarnings("serial")
public class RegisterForm extends ActionForm {
String name;
String rpassword;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRpassword() {
return rpassword;
}
public void setRpassword(String rpassword) {
this.rpassword = rpassword;
}
@Override
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if ((getRpassword().length() < 3) || (getRpassword().length() > 11)) {
errors
.add("rpassword", new ActionMessage(
"errors.password.length"));
}
if (getName().equalsIgnoreCase("") || getName() == null) {
errors.add("name", new ActionMessage("errors.username.required"));
}
return errors;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -