bonjour,

j'ai le problème suivant, lorsque je clique sur le bouton valider ou supprimer de mon formulaire suivant. Ca passe 2 fois par la méthode correspondante, remove ou validate.

je ne comprend pas pourquoi =_='

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
 
 
<html:form styleId="lots" action="ValidationSuppressionAction" method="POST">    
<logic:iterate id="ConsigneNonValide" name="LISTCONSIGNESNONVALIDES" property="listeConsignesScheduling">        
 
<html:hidden property="hidden" name="hidden" value=""/>
 
                    <tr style="text-align:center; padding:2px 0px 2px 0px;border-bottom: 1px #76001F solid; background-color:#F1EEE9; font-weight: bold; font-family: Arial; font-size:10px;" valign="top">
 
                      <td style=" text-align:center; padding:2px 0px 2px 0px;border-bottom: 1px #76001F solid; background-color:#F1EEE9; font-weight: bold; font-family: Arial; font-size:10px;">
                      <bean:write name="ConsigneNonValide" property="dateCreation"/>
                      </td>                                  
                    <td style=" text-align:center; padding:2px 0px 2px 0px;border-bottom: 1px #76001F solid; background-color:#F1EEE9; font-weight: bold; font-family: Arial; font-size:10px;">
                    <bean:write name="ConsigneNonValide" property="session"/>
                    </td>
 
                    <td style=" text-align:center; padding:2px 0px 2px 0px;border-bottom: 1px #76001F solid; background-color:#F1EEE9; font-weight: bold; font-family: Arial; font-size:10px;">
                    <bean:write name="ConsigneNonValide" property="ug"/>
                    </td>
 
                    <td style=" text-align:center; padding:2px 0px 2px 0px;border-bottom: 1px #76001F solid; background-color:#F1EEE9; font-weight: bold; font-family: Arial; font-size:10px;">
                        <bean:write name="ConsigneNonValide" property="uproc_job"/>
                    </td>
                    <td style="text-align:center; padding:2px 0px 2px 0px;border-bottom: 1px #76001F solid; background-color:#F1EEE9; font-weight: bold; font-family: Arial; font-size:10px;">
                    <bean:write name="ConsigneNonValide" property="code_erreur"/>
                    </td>
                    <td style=" text-align:center; padding:2px 0px 2px 0px;border-bottom: 1px #76001F solid; background-color:#F1EEE9; font-weight: bold; font-family: Arial; font-size:10px;">
                    <bean:write name="ConsigneNonValide" property="contenu"/>
                    </td>  
 
                    <td style=" text-align:center; padding:2px 0px 2px 0px;border-bottom: 1px #76001F solid; background-color:#F1EEE9; font-weight: bold; font-family: Arial; font-size:10px;">
                    <bean:write name="ConsigneNonValide" property="trigramme"/>
                    </td>
 
                    <td  style=" text-align:center; padding:2px 0px 2px 0px;border-bottom: 1px #76001F solid; background-color:#F1EEE9; font-weight: bold; font-family: Arial; font-size:10px;">
                    <a target="_blank" style="color:black;" href="http://vmpar02har1:8080/WebApplication2/AfficheConsigneFr.do?id=<bean:write name="ConsigneNonValide" property="id_consigne"/>">
                    <img border="0" style="width: 17px; height: 11px;" alt="" src="Images\france.bmp">
                    </a>
                    <a target="_blank" style="color:black;" href="http://vmpar02har1:8080/WebApplication2/AfficheConsigneAn.do?id=<bean:write name="ConsigneNonValide" property="id_consigne"/>">
                    <img border="0" style="width: 17px; height: 11px;" alt="" src="Images\angeterre.bmp">
                    </a>
 
                    </td>
 
                    <td style="text-align:center; padding:2px 0px 2px 0px;border-bottom: 1px #76001F solid; background-color:#F1EEE9; font-weight: bold; font-family: Arial; font-size:10px;">
                    <bean:write name="ConsigneNonValide" property="existence" />
                    </td>  
 
                    <td >
                      <input type = "checkbox" name="idValidation" value="<bean:write name="ConsigneNonValide" property="id"/>"/>
                    </td>
 
                    <td valign="bottom">
                        <html:image property="submit" src="Images\poubelle.gif" onclick="if(window.confirm('Vous êtes sur de vouloir supprimer'))
                                                    {setHidden('remove');
                                                        location.href='Etat_publication.jsp';return true;} else {return false;}">
                        </html:image>
 
                    </td>
                    <td valign="bottom">
                         <html:image style="width: 15px; height:15px; " property="submit" src="Images\f_5_.gif" onclick="if(window.confirm('Vous êtes sur de vouloir valider'))
                                                                                                                            {setHidden('validate');
                                                                                                                            location.href='Etat_publication.jsp';return true;} else {return false;}">"> 
                         </html:image>
                    </td>
                     </tr>
    </logic:iterate>
</html:form>
dans mon struts-conf, j'ai ceci:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
 
  <action path="/ValidationSuppressionAction"
            type="fr.edition.eni.action.ValidationSuppressionAction"
            scope="request"
            name="EtatPublicationForm"
            input="/LancerConsignesNonValidesAction.do"
            validate="true"
            parameter="hidden">
            <forward name="success" path="/LancerConsignesNonValidesActionSansAuthentification.do" redirect="true"></forward>
            <forward name="erreur" path="/LancerConsignesNonValidesAction.do"></forward>
        </action>
et mes méthode validate et remove:

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
 
public ActionForward validate(ActionMapping mapping,ActionForm form, 
                                 HttpServletRequest request, HttpServletResponse response)throws Exception{
 
                     EtatPublicationForm consignesForm = (EtatPublicationForm) form;
        System.out.println("// ne pas envoyer à cette personne null mail 2 ");
 
    }   
 
      public ActionForward remove(ActionMapping mapping, ActionForm form, HttpServletRequest request, 
                 HttpServletResponse response)throws Exception{
                EtatPublicationForm consignesForm = (EtatPublicationForm) form;
 
                System.out.println("//// Id consigne à supprimer : " );
 
   }