@Override
    public String execute() throws Exception {
        try {

            Map session = ActionContext.getContext().getSession();
            setUser((User) session.get("User"));


            setUserdetails((UserDetails) getMyDao().getDbsession().get(UserDetails.class, getUser().getEmailId()));


            if (getUserdetails() != null) {


                Criteria ucri = getMyDao().getDbsession().createCriteria(UserDetails.class);
                ucri.add(Restrictions.like("user", getUser().getEmailId()));
                ucri.setMaxResults(1);
                setUserdetails((UserDetails) (ucri.list().get(0)));

                return "update";
            } else {


                return "save";
            }
        } 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";
        }
    }