?? loginform.java
字號:
/**
* 作者: 佟勁緯 創建日期: 2006-1-10
*
* QQ: 532443423 Email: TJW_7@163.com
*/
package com.tjw.guestbook.form;
import org.apache.struts.action.*;
import javax.servlet.http.*;
/**
*
*/
public final class LoginForm extends ActionForm {
private String url = null;
private String userName = null;
private String password = null;
public void setUrl(String url) {
this.url = url;
}
public String getUrl() {
return this.url;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserName() {
return this.userName;
}
public void setPassword(String password) {
this.password = password;
}
public String getPassword() {
return this.password;
}
public void reset(ActionMapping mapping, HttpServletRequest request) {
this.userName = null;
this.password = null;
this.url = null;
}
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if (userName == null || userName.length() <= 0) {
errors.add("userNameError", new ActionMessage("error.name.null"));
} else if (userName.length() <= 2) {
errors.add("userNameError", new ActionMessage("error.name.small"));
}
if (password == null || password.length() <= 0) {
errors.add("passwordError", new ActionMessage(
"error.password.null"));
} else if (password.length() <= 5) {
errors.add("passwordError", new ActionMessage(
"error.password.small"));
}
return errors;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -