📄 personform.java
字号:
package tarena.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; public class PersonForm extends ActionForm { private Integer id; private String password; private String name; private String flag; public String getFlag() { return flag; } public void setFlag(String flag) { this.flag = flag; } public ActionErrors validate( ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if(name==null||name.trim().length()<1) { errors.add("info.name", new ActionMessage("info.name")); } if(password==null||password.trim().length()<1) { errors.add("info.password", new ActionMessage("info.password")); } return errors; } public void reset(ActionMapping mapping, HttpServletRequest request) { name=""; password=""; id = null; } /** * Returns the password. * @return String */ public String getPassword() { return password; } /** * Set the password. * @param password The password to set */ public void setPassword(String password) { this.password = password; } /** * Returns the name. * @return String */ public String getName() { return name; } /** * Set the name. * @param name The name to set */ public void setName(String name) { this.name = name; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -