/TourismSystem/src/cn/edu/buaa/scse/liyi/form/GuestForm.java

http://tourismsystem.googlecode.com/ · Java · 166 lines · 144 code · 19 blank · 3 comment · 2 complexity · ebbaf7e0290a081dc08efe54a3170a94 MD5 · raw file

  1. package cn.edu.buaa.scse.liyi.form;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4. import javax.servlet.http.HttpServletRequest;
  5. import org.apache.struts.Globals;
  6. import org.apache.struts.action.ActionErrors;
  7. import org.apache.struts.action.ActionForm;
  8. import org.apache.struts.action.ActionMapping;
  9. import org.apache.struts.action.ActionMessage;
  10. import cn.edu.buaa.scse.liyi.model.Guest;
  11. public class GuestForm extends ActionForm
  12. {
  13. /**
  14. *
  15. */
  16. private static final long serialVersionUID = 1L;
  17. private String userid;
  18. private String username;
  19. private String useroldpwd;
  20. private String usernewpwd;
  21. private String usernewpwd_submit;
  22. private String applyrole;
  23. private String userphone;
  24. private String useremail;
  25. private String applyreason;
  26. private Guest guest;
  27. private List<Guest> guestlist;
  28. public GuestForm()
  29. {
  30. super();
  31. }
  32. public void reset(ActionMapping mapping,HttpServletRequest request)
  33. {
  34. userid="";
  35. username="";
  36. useroldpwd="";
  37. usernewpwd="";
  38. usernewpwd_submit="";
  39. applyrole="";
  40. userphone="";
  41. useremail="";
  42. applyreason="";
  43. guest=new Guest();
  44. guestlist=new ArrayList<Guest>();
  45. }
  46. public ActionErrors validate(ActionMapping mapping,HttpServletRequest request)
  47. {
  48. ActionErrors errors=new ActionErrors();
  49. String mappingName=mapping.getPath();
  50. if(mappingName.equalsIgnoreCase("/userList"))
  51. {
  52. if(!usernewpwd.equals(usernewpwd_submit))
  53. {
  54. errors.add(Globals.ERROR_KEY,new ActionMessage(""));
  55. }
  56. }
  57. return errors;
  58. }
  59. public void setUserid(String userid)
  60. {
  61. this.userid=userid;
  62. }
  63. public String getUserid()
  64. {
  65. return userid;
  66. }
  67. public void setUsername(String username)
  68. {
  69. this.username=username;
  70. }
  71. public String getUsername()
  72. {
  73. return username;
  74. }
  75. public void setUseroldpwd(String useroldpwd)
  76. {
  77. this.useroldpwd=useroldpwd;
  78. }
  79. public String getUseroldpwd()
  80. {
  81. return useroldpwd;
  82. }
  83. public void setUsernewpwd(String usernewpwd)
  84. {
  85. this.usernewpwd=usernewpwd;
  86. }
  87. public String getUsernewpwd()
  88. {
  89. return usernewpwd;
  90. }
  91. public void setUsernewpwd_submit(String usernewpwd_submit)
  92. {
  93. this.usernewpwd_submit=usernewpwd_submit;
  94. }
  95. public String getUsernewpwd_submit()
  96. {
  97. return usernewpwd_submit;
  98. }
  99. public void setApplyrole(String applyrole)
  100. {
  101. this.applyrole=applyrole;
  102. }
  103. public String getApplyrole()
  104. {
  105. return applyrole;
  106. }
  107. public void setUserphone(String userphone)
  108. {
  109. this.userphone=userphone;
  110. }
  111. public String getUserphone()
  112. {
  113. return userphone;
  114. }
  115. public void setUseremail(String useremail)
  116. {
  117. this.useremail=useremail;
  118. }
  119. public String getUseremail()
  120. {
  121. return useremail;
  122. }
  123. public void setApplyreason(String applyreason)
  124. {
  125. this.applyreason=applyreason;
  126. }
  127. public String getApplyreason()
  128. {
  129. return applyreason;
  130. }
  131. public void setGuest(Guest guest)
  132. {
  133. this.guest=guest;
  134. }
  135. public Guest getGuest()
  136. {
  137. return guest;
  138. }
  139. public void setGuestlist(List<Guest> guestlist)
  140. {
  141. this.guestlist=guestlist;
  142. }
  143. public List<Guest> getGuestlist()
  144. {
  145. return guestlist;
  146. }
  147. }