Guest User

Untitled

a guest
Mar 15th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. package cipc.web.action;
  2.  
  3. import cipc.model.User;
  4.  
  5. import com.opensymphony.xwork.Preparable;
  6.  
  7. public class LoginAction extends BaseAction implements Preparable {
  8. String userId;
  9.  
  10. String password;
  11.  
  12. User user;
  13.  
  14. public void prepare() throws Exception {
  15. user = manager.getUserByUserId(userId);
  16. }
  17.  
  18. public String execute() {
  19. if (user == null)
  20. return INPUT;
  21.  
  22. if (user.getPassword().equals(password)) {
  23. setCurrentUser(user);
  24. return SUCCESS;
  25. }
  26.  
  27. return INPUT;
  28. }
  29.  
  30. public String getPassword() {
  31. return password;
  32. }
  33.  
  34. public void setPassword(String password) {
  35. this.password = password;
  36. }
  37.  
  38. public String getUserId() {
  39. return userId;
  40. }
  41.  
  42. public void setUserId(String userId) {
  43. this.userId = userId;
  44. }
  45.  
  46. }
Add Comment
Please, Sign In to add comment