📄 loginform.java
字号:
package registerapp;
import org.apache.struts.action.*;
import javax.servlet.http.HttpServletRequest;
/*
* @author ye fei
* @version 1.00, 2003/04/15
* @copyright www.studyjava.com
*/
public class LoginForm extends ActionForm {
protected String username;
protected String password1;
/**
* get user name,return a String.
*/
public String getUsername() {
return this.username;
};
/**
* get Password,return a String.
*/
public String getPassword1() {
return this.password1;
};
/**
* set user name
*/
public void setUsername(String username) {
this.username = username;
};
/**
* set Password
*/
public void setPassword1(String password) {
this.password1 = password;
};
/**
* Validate the request parameters specified by user
*/
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if ((username == null) || (username.length() < 1))
errors.add("username", new ActionError("error.username.required"));
if ((password1 == null) || (password1.length() < 1))
errors.add("username", new ActionError("error.password.required"));
return errors;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -