@Override
    public String execute() throws Exception {
        try {
            session = ActionContext.getContext().getSession();
            User u1 = (User) session.get("User");
            if (existpass.isEmpty()) {
                addActionError("Please Enter existing password");
                return "error";
            } else {
                Criteria ucri = getMyDao().getDbsession().createCriteria(User.class);
                ucri.add(Restrictions.eq("emailId", u1.getEmailId()));
                ucri.add(Restrictions.eq("password", existpass));
                ucri.setMaxResults(1);
                if (ucri.list().isEmpty()) {
                    addActionError("Current password doesn't match please try again");
                    return "error";
                } else {
                    user = (User) myDao.getDbsession().get(User.class, u1.getEmailId());
                    user.setPassword(newpass);
                    myDao.getDbsession().update(user);
                    session.put("User", user);
                    addActionMessage("New Password Successfully Changed");
                    return "success";
                }

            }

        } catch (HibernateException e) {
            addActionError("Server  Error Please Try Again Later ");
            e.printStackTrace();
            return "error";
        } catch (NullPointerException ne) {

            addActionError("Server  Error Please Try Again Later ");
            ne.printStackTrace();
            return "error";
        } catch (Exception e) {

            addActionError("Server  Error Please Try Again Later ");
            e.printStackTrace();
            return "error";
        }

    }