@Override
    public void validate() {
        session = ActionContext.getContext().getSession();
        User u1 = (User) session.get("User");
        Criteria ucri = getMyDao().getDbsession().createCriteria(User.class);
        ucri.add(Restrictions.eq("emailId", u1.getEmailId()));
        ucri.add(Restrictions.eq("password", existpass));
        ucri.setMaxResults(1);
        if (existpass.isEmpty()) {

            addActionError("Please Enter Existing Password");
        } else if (ucri.list().isEmpty()) {
            addActionError("Current password doesn't match please try again");

        }

        if (newpass.isEmpty()) {

            addActionError("Please Enter New Password");
        }
        if (cfnewpass.isEmpty()) {

            addActionError("Please Enter Confirm New Password");
        } else if (!cfnewpass.equals(newpass) && !newpass.equals(cfnewpass)) {

            addActionError("New Password & Confirm New Password Mismatch Please Enter Again");
        }
    }