public String signUp() { if (ProcessUser.selectUser(username) != null) { result = LOGIN; } else { User user = new User(); user.setFullname(fullName); user.setUsername(username); user.setPassword(password); ProcessUser.insertUser(user); setSession(user); result = SUCCESS; } return result; }
public String execute() throws SQLException { User user = ProcessUser.selectUser(username); if (user != null) { if (password.equals(user.getPassword())) { setSession(user); result = SUCCESS; } else result = LOGIN; } else { result = LOGIN; return LOGIN; } return result; }