@Override
    public User authenticate(String userId, String password) {
        String redirect = "";
        boolean loop = true;
        GenericDAO<User> userDAO = new UserDAO();
        User user = null;
        List<User> list = userDAO.getList("from User");
        Iterator<User> it = list.iterator();
        while (it.hasNext() && loop) {
            User u = it.next();
            if (userId.equals(u.getUserLogin()) && password.equals(u.getUserPassword())) {
                user = u;
                loop = false;  // will break loop
            }
        }
        return user;
    }