RegisterForm.java
上传用户:sz_mindeo
上传日期:2015-07-22
资源大小:913k
文件大小:2k
源码类别:

Ajax

开发平台:

Java

  1. package com.haiku.form;
  2. /*
  3.  * Generated by MyEclipse Struts
  4.  * Template path: templates/java/JavaClass.vtl
  5.  */
  6. import javax.servlet.http.HttpServletRequest;
  7. import org.apache.struts.action.ActionErrors;
  8. import org.apache.struts.action.ActionForm;
  9. import org.apache.struts.action.ActionMapping;
  10. import org.apache.struts.action.ActionMessage;
  11. /** 
  12.  * MyEclipse Struts
  13.  * Creation date: 03-13-2008
  14.  * 
  15.  * XDoclet definition:
  16.  * @struts.form name="loginForm"
  17.  */
  18. public class RegisterForm extends ActionForm {
  19. /*
  20.  * Generated fields
  21.  */
  22. /** password property */
  23. /** userName property */
  24. private String userName;
  25. private String password;
  26. /*
  27.  * Generated Methods
  28.  */
  29. /** 
  30.  * Method validate
  31.  * @param mapping
  32.  * @param request
  33.  * @return ActionErrors
  34.  */
  35. public ActionErrors validate(ActionMapping mapping,
  36. HttpServletRequest request) {
  37. // TODO Auto-generated method stub
  38. ActionErrors errors = null;
  39. System.out.println("来到validate方法");
  40. if(userName==null||userName.trim().equalsIgnoreCase("")||password==null||password.trim().equalsIgnoreCase(""))
  41. {
  42. System.out.println("validate里检验出错");
  43. errors = new ActionErrors();
  44. errors.add("error", new ActionMessage("名字或密码不能为空"));
  45. return errors;
  46. }
  47. else
  48. return null;
  49. }
  50. /** 
  51.  * Method reset
  52.  * @param mapping
  53.  * @param request
  54.  */
  55. public void reset(ActionMapping mapping, HttpServletRequest request) {
  56. // TODO Auto-generated method stub
  57. }
  58. /** 
  59.  * Returns the password.
  60.  * @return String
  61.  */
  62. public String getPassword() {
  63. return password;
  64. }
  65. /** 
  66.  * Set the password.
  67.  * @param password The password to set
  68.  */
  69. public void setPassword(String password) {
  70. this.password = password;
  71. }
  72. /** 
  73.  * Returns the userName.
  74.  * @return String
  75.  */
  76. public String getUserName() {
  77. return userName;
  78. }
  79. /** 
  80.  * Set the userName.
  81.  * @param userName The userName to set
  82.  */
  83. public void setUserName(String userName) {
  84. this.userName = userName;
  85. }
  86. }