📄 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 + -