Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package cipc.web.action;
- import cipc.model.User;
- import com.opensymphony.xwork.Preparable;
- public class LoginAction extends BaseAction implements Preparable {
- String userId;
- String password;
- User user;
- public void prepare() throws Exception {
- user = manager.getUserByUserId(userId);
- }
- public String execute() {
- if (user == null)
- return INPUT;
- if (user.getPassword().equals(password)) {
- setCurrentUser(user);
- return SUCCESS;
- }
- return INPUT;
- }
- public String getPassword() {
- return password;
- }
- public void setPassword(String password) {
- this.password = password;
- }
- public String getUserId() {
- return userId;
- }
- public void setUserId(String userId) {
- this.userId = userId;
- }
- }
Add Comment
Please, Sign In to add comment