?? loginform.java
字號:
package examples;
import org.apache.struts.action.*;import javax.servlet.http.HttpServletRequest;public class LoginForm extends ActionForm { private String username; private String password; public void setUsername(String username) { this.username = username; } public String getUsername() { return this.username; } public String getPassword() { return this.password; } public void setPassword(String password) { this.password = password; } 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 ((password == null) || (password.length() < 1)) errors.add("password",new ActionError("error.password.required")); if (errors.isEmpty()) return null; else return errors; }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -