Bonjour a tous,

j'essaye d'utiliser le LookUpDispatchAction mais j'ai une erreur :

Action[/modifierTerme] does not contain specified method

Je ne trouve pas pourquoi ...

Donc, voila ma classe Action :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
 
 
public class ModifierTermeAction extends DispatchAction {
 
	public ActionForward ajouter(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		ModifierTermeForm modifierTermeForm = (ModifierTermeForm) form;
 
		Terme terme = new Terme();
		TermeDAO ter = new TermeDAO();
		ThesaurusDAO dao = new ThesaurusDAO();
 
		terme.setIdTerme(modifierTermeForm.getIdTerme());
		terme.setIdLangue(modifierTermeForm.getIdLangue());
		terme.setIdThesaurus(modifierTermeForm.getIdThesaurus());
		terme.setDescripteur(modifierTermeForm.getDescripteur());
		terme.setNoteApplication(modifierTermeForm.getNoteApplication());
		terme.setNoteHistorique(modifierTermeForm.getNoteHistorique());
		terme.setType(modifierTermeForm.getType());
		terme.setIdMt(modifierTermeForm.getIdMt());
		terme.setTest(modifierTermeForm.getTest());
 
 
		Transaction tx = ter.getSession().beginTransaction();
 
		ter.save(terme);
 
		tx.commit();
 
		List theso = dao.findAll();
		List termeList = ter.findAll();
 
		request.setAttribute("afficherTheso", theso);
		request.setAttribute("afficherTerme", termeList);
 
		ter.getSession().close();
 
		return mapping.findForward("success");
 
	}
 
	public ActionForward effacer(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		ModifierTermeForm modifierTermeForm = (ModifierTermeForm) form;
 
		TermeDAO ter = new TermeDAO();		
		ThesaurusDAO dao = new ThesaurusDAO();
 
		List terme = ter.findByDescripteur(modifierTermeForm.getDescripteur());
		Transaction tx = ter.getSession().beginTransaction();
 
		if (terme.size() > 0) {			
			for(Iterator iter = terme.iterator(); iter.hasNext();)
			{
				Terme result = (Terme) iter.next();
				if((modifierTermeForm.getDescripteur()).equalsIgnoreCase(result.getDescripteur())){
					System.out.println(result.getDescripteur());
					ter.delete(result);
					tx.commit();
				}
			}
		}
		List theso = dao.findAll();
		List termeList = ter.findAll();
 
		request.setAttribute("afficherTheso", theso);
		request.setAttribute("afficherTerme", termeList);
 
		ter.getSession().close();
 
	return mapping.findForward("success");
 
	}
 
 
	@SuppressWarnings("unchecked")
	protected Map getKeyMethodMap() {
		Map map = new HashMap();
		map.put("ajouter", "add");
		map.put("effacer", "delete");
		return map;
	}
Ensuite ma Jsp :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
<body>
		<html:form action="/modifierTerme">
			descripteur : <html:text property="descripteur"/><html:errors property="descripteur"/><br/>
		<html:submit property="monAction">
		 <bean:message key="add"/>
		</html:submit>
		<html:submit property="monAction">
		 <bean:message key="delete"/>
		</html:submit>
		<html:cancel/><br/><br/>
 
			idTerme : <html:text property="idTerme"/><html:errors property="idTerme"/><br/>
			idLangue : <html:text property="idLangue"/><html:errors property="idLangue"/><br/>
			idThesaurus : <html:text property="idThesaurus"/><html:errors property="idThesaurus"/><br/>
			noteApplication : <html:text property="noteApplication"/><html:errors property="noteApplication"/><br/>
			noteHistorique : <html:text property="noteHistorique"/><html:errors property="noteHistorique"/><br/>
			type : <html:text property="type"/><html:errors property="type"/><br/>
			idMt : <html:text property="idMt"/><html:errors property="idMt"/><br/>
			test : <html:text property="test"/><html:errors property="test"/><br/>
		</html:form>
	</body>

et enfin, ma config struts :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
 
 
 <action
      attribute="modifierTermeForm"
      input="/form/modifierTerme.jsp"
      name="modifierTermeForm"
      path="/modifierTerme"
      parameter="monAction"
      scope="request"
      type="bean.action.ModifierTermeAction">
      <set-property property="cancellable" value="true" />
      <forward name="success" path="/afficherTheso.jsp" />
    </action>
J'ai trouvé ce systême sur le FAQ....

Merci de votre aide ...