public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		ManagevocabForm managevocabForm = (ManagevocabForm) form;// TODO Auto-generated method stub
		
		String edit= managevocabForm.getEdit();
		String output="remove";
		Logger log = Logger.getLogger(TextAction.class);

		
		VocabulaireDAO vocdao = new VocabulaireDAO();
		Vocabulaire voc = new Vocabulaire();
		long id;
		String index;
		
		if (edit.contains("Delete")){
			index = (String) edit.subSequence(7, edit.length());
			id = Long.parseLong(index);
			voc = vocdao.findById(id);
			
			Session hsf = HibernateSessionFactory.getSession();
			Transaction trans = hsf.beginTransaction();
			hsf.delete(voc); 
			trans.commit();
			hsf.close();
			
			output="remove";
			request.getSession().setAttribute("info", "The vocabulary has been deleted.");
			log.info("The vocabulary with the id " + voc.getIdVocab() + " has been deleted.");
		}
		
		else if (edit.contains("Add")){
			output="addvocab";
		}
		
		else if (edit.contains("Edit")){
			index = (String) edit.subSequence(5, edit.length());
			id = Long.parseLong(index);
			voc = vocdao.findById(id);
			
			
			request.getSession().setAttribute("index", index);
			request.getSession().setAttribute("user", voc.getCompte());
			request.getSession().setAttribute("vocab", voc.getNomVocab());
			
			output="editvocab";
		}
		
		return mapping.findForward(output);
	}