📄 addteacherform.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="addTeacherForm" */public class AddTeacherForm extends ActionForm { // --------------------------------------------------------- Instance Variables /** password property */ private String password; /** age property */ private String age; /** title property */ private String title; /** address property */ private String address; /** telephone property */ private String telephone; /** username property */ private String username; /** email property */ private String email; /** name property */ private String name; /** name property */ private String sex; private Long classes_id; // --------------------------------------------------------- Methods public Long getClasses_id() { return classes_id; } public void setClasses_id(Long classes_id) { this.classes_id = classes_id; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } /** * Method validate * @param mapping * @param request * @return ActionErrors */ public ActionErrors validate( ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if ((password == null) || (password.length() < 1)) errors.add("sex", new ActionMessage("error.password.required")); if ((age == null) || (age.length() < 1)) errors.add("age", new ActionMessage("error.age.required")); if ((title == null) || (title.length() < 1)) errors.add("title", new ActionMessage("error.title.required")); if ((address == null) || (address.length() < 1)) errors.add("address", new ActionMessage("error.address.required")); if ((telephone == null) || (telephone.length() < 1)) errors.add("telephone", new ActionMessage("error.telephone.required")); if ((username == null) || (username.length() < 1)) errors.add("username", new ActionMessage("error.username.required")); if ((email == null) || (email.length() < 1)) errors.add("email", new ActionMessage("error.email.required")); if ((name == null) || (name.length() < 1)) errors.add("name", new ActionMessage("error.name.required")); if ((sex == null) || (sex.length() < 1)) errors.add("sex", new ActionMessage("error.sex.required")); return errors; } /** * Method reset * @param mapping * @param request */ public void reset(ActionMapping mapping, HttpServletRequest request) { this.password = null; this.age = null; this.title = null; this.address = null; this.telephone = null; this.username = null; this.email = null; this.name=null; this.sex = 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 age. * @return int */ public String getAge() { return age; } /** * Set the age. * @param age The age to set */ public void setAge(String age) { this.age = age; } /** * Returns the title. * @return String */ public String getTitle() { return title; } /** * Set the title. * @param title The title to set */ public void setTitle(String title) { this.title = title; } /** * Returns the address. * @return String */ public String getAddress() { return address; } /** * Set the address. * @param address The address to set */ public void setAddress(String address) { this.address = address; } /** * Returns the telephone. * @return String */ public String getTelephone() { return telephone; } /** * Set the telephone. * @param telephone The telephone to set */ public void setTelephone(String telephone) { this.telephone = telephone; } /** * 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; } /** * 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 + -