public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		VocalmanForm vocalmanForm = (VocalmanForm) form;// TODO Auto-generated method stub
		
		String output ="doneedit";
		String index = vocalmanForm.getIndex();
		String user = vocalmanForm.getUser();
		String vocab = vocalmanForm.getVocab();
		String man = vocalmanForm.getMan();
		
		Logger log = Logger.getLogger(TextAction.class);
		VocabulaireDAO vocdao = new VocabulaireDAO();
		Vocabulaire voc = new Vocabulaire();
		CompteDAO codao = new CompteDAO();
		Compte comp = codao.findById(user);
		long id;
		
		if (man.contains("Add")){
			voc.setCompte(comp);
			voc.setNomVocab(vocab);
			
			Session hsf = HibernateSessionFactory.getSession();
			Transaction trans = hsf.beginTransaction();
			hsf.saveOrUpdate(voc); 
			trans.commit();
			hsf.close();
			
			request.getSession().setAttribute("info", "The vocabulary has been added.");
			log.info("The vocabulary with the id " + voc.getIdVocab() + " has been added.");
			output ="doneadd";
		}
		else if (man.contains("Save")){
			id = Long.parseLong(index);
			voc = vocdao.findById(id);
			voc.setIdVocab(id);
			voc.setCompte(comp);
			voc.setNomVocab(vocab);
			
			Session hsf = HibernateSessionFactory.getSession();
			Transaction trans = hsf.beginTransaction();
			hsf.saveOrUpdate(voc); 
			trans.commit();
			hsf.close();
			
			request.getSession().setAttribute("info", "The vocabulary has been modified.");
			log.info("The vocabulary with the id " + voc.getIdVocab() + " has been modified.");
			output ="doneedit";
		}
		
		
		return mapping.findForward(output);
	}