📄 addstudentform.java
字号:
//Created by MyEclipse Struts// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.0.0/xslt/JavaClass.xslpackage struts.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;/** * MyEclipse Struts * Creation date: 11-12-2005 * * XDoclet definition: * @struts.form name="addStudentForm" */public class AddStudentForm extends ActionForm { // --------------------------------------------------------- Instance Variables /** sex property */ private String sex; /** password property */ private String password; /** dep property */ private String department; /** username property */ private String username; /** email property */ private String email; /** tel property */ private String telephone; /** name property */ private String name; private Long teacher_id; private String student_number; private Integer age; private String address; private Integer mark; // --------------------------------------------------------- Methods public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public Integer getMark() { return mark; } public void setMark(Integer mark) { this.mark = mark; } public String getStudent_number() { return student_number; } public void setStudent_number(String student_number) { this.student_number = student_number; } public Long getTeacher_id() { return teacher_id; } public void setTeacher_id(Long teacher_id) { this.teacher_id = teacher_id; } /** * Method validate * @param mapping * @param request * @return ActionErrors */ public ActionErrors validate( ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if ((sex == null) || (sex.length() < 1)) errors.add("sex", new ActionMessage("error.sex.required")); if ((username == null) || (username.length() < 1)) errors.add("username", new ActionMessage("error.username.required")); if ((password == null) || (password.length() < 1)) errors.add("password", new ActionMessage("error.password.required")); if ((email == null) || (email.length() < 1)) errors.add("email", new ActionMessage("error.email.required")); if ((department == null) || (department.length() < 1)) errors.add("department", new ActionMessage("error.department.required")); if ((telephone == null) || (telephone.length() < 1)) errors.add("telephone", new ActionMessage("error.telephone.required")); if ((name == null) || (name.length() < 1)) errors.add("name", new ActionMessage("error.name.required")); return errors; } /** * Method reset * @param mapping * @param request */ public void reset(ActionMapping mapping, HttpServletRequest request) { this.sex = null; this.password = null; this.telephone = null; this.email = null; this.username = null; this.department = null; this.name = null; } /** * Returns the sex. * @return String */ public String getSex() { return sex; } /** * Set the sex. * @param sex The sex to set */ public void setSex(String sex) { this.sex = sex; } /** * 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 username. * @return String */ public String getUsername() { return username; } /** * Set the username. * @param username The username to set */ public void setUsername(String username) { this.username = username; } /** * Returns the email. * @return String */ public String getEmail() { return email; } /** * Set the email. * @param email The email to set */ public void setEmail(String email) { this.email = email; } public String getDepartment() { return department; } public void setDepartment(String department) { this.department = department; } public String getTelephone() { return telephone; } public void setTelephone(String telephone) { this.telephone = telephone; } /** * 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; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -