📄 studentactionform.java
字号:
package studentInfo;import org.apache.struts.action.*;import javax.servlet.http.*;public class StudentActionForm extends ActionForm { private String age; private String name; private String sex; private String studNo; public String getAge() { return age; } public void setAge(String age) { this.age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getStudNo() { return studNo; } public void setStudNo(String studNo) { this.studNo = studNo; } public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { ActionErrors errors = new ActionErrors(); if((studNo==null)||(studNo.length()<3)) { errors.add("studNo",new ActionMessage("error.studNo.required",studNo)); } if((name==null)||(name.length()<3)) { errors.add("name",new ActionMessage("error.name.required",name)); } if((age==null)||(age.length()>3)) { errors.add("age",new ActionMessage("error.age.required",age)); } return errors; } public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -