📄 registerform.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package bugtrail.form;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import bugtrail.basic.Staff;
/**
* MyEclipse Struts
* Creation date: 01-03-2007
*
* XDoclet definition:
* @struts.form name="registerForm"
*/
public class RegisterForm extends ActionForm {
/*
* Generated fields
*/
private Staff staff = new Staff();
/** phone property */
private String phone;
/** remark property */
private String remark;
/** address property */
private String address;
/** email property */
private String email;
/** department property */
private String department;
/** pswAnswer property */
private String pswAnswer;
/** name property */
private String name;
/** password_again property */
private String password_again;
/** password property */
private String password;
/** pswQuestion property */
private String pswQuestion;
/*
* Generated Methods
*/
/**
* Method validate
* @param mapping
* @param request
* @return ActionErrors
*/
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if(getEmail().length()<1)
errors.add("email",new ActionError("email.error"));
if(getPassword().length()<1)
errors.add("password", new ActionError("password.null"));
if(getPassword_again().length()<1)
errors.add("password_again", new ActionError("password_again.null"));
if(getName().length()<1)
errors.add("name", new ActionError("name.null"));
if(getPhone().length()<0||!getPhone().matches("\\d+"))
errors.add("phone", new ActionError("phone.error"));
if(!getPassword().equals(getPassword_again()))
errors.add("password_again", new ActionError("two.password.not.same"));
return errors;
}
/**
* Method reset
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
staff = new Staff();
}
/**
* Returns the phone.
* @return String
*/
public String getPhone() {
return phone;
}
/**
* Set the phone.
* @param phone The phone to set
*/
public void setPhone(String phone) {
this.phone = phone;
}
/**
* Returns the remark.
* @return String
*/
public String getRemark() {
return remark;
}
/**
* Set the remark.
* @param remark The remark to set
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* 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 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 department.
* @return String
*/
public String getDepartment() {
return department;
}
/**
* Set the department.
* @param department The department to set
*/
public void setDepartment(String department) {
this.department = department;
}
/**
* Returns the pswAnswer.
* @return String
*/
public String getPswAnswer() {
return pswAnswer;
}
/**
* Set the pswAnswer.
* @param pswAnswer The pswAnswer to set
*/
public void setPswAnswer(String pswAnswer) {
this.pswAnswer = pswAnswer;
}
/**
* 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;
}
/**
* Returns the password_again.
* @return String
*/
public String getPassword_again() {
return password_again;
}
/**
* Set the password_again.
* @param password_again The password_again to set
*/
public void setPassword_again(String password_again) {
this.password_again = password_again;
}
/**
* 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 pswQuestion.
* @return String
*/
public String getPswQuestion() {
return pswQuestion;
}
/**
* Set the pswQuestion.
* @param pswQuestion The pswQuestion to set
*/
public void setPswQuestion(String pswQuestion) {
this.pswQuestion = pswQuestion;
}
public Staff getStaff(){
staff.setEmail(email);
staff.setName(name);
staff.setPassword(password);
staff.setDepartment(Integer.parseInt(getDepartment()));
staff.setPswQuestion(pswQuestion);
staff.setPswAnswer(pswAnswer);
staff.setPhone(Integer.parseInt(phone));
staff.setAddress(address);
staff.setRemark(remark);
return staff;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -