public String authenticate() {
        ScopeUtil scopeUtil = new ScopeUtil();
        String redirect = "";
        loginId = "test";
        password = "123";
        boolean loop = true;
        GenericDAO<User> userDAO = new UserDAO();
        List<User> list = userDAO.getList("from User");
        Iterator<User> it = list.iterator();
        while (it.hasNext() && loop) {
            User u = it.next();
            if (loginId.equals(u.getUserLogin()) && password.equals(u.getUserPassword())) {
                HttpSession session=scopeUtil.getSession(true);
                session.setAttribute("userInfo",u);
                redirect = "Home?faces-redirect=true";
                loop = false;  // will break loop
            }
        }
        if (loop) {
            FacesContext.getCurrentInstance().addMessage("", new FacesMessage("Username or password is incorrect"));
        }
        return redirect;
    }