Bonjour à tous,
Je n'arrive pas à récupérer une propriété de ma jsp dans ma classe action avec DynaValidatorForm.
Voici un morceau de ma jsp :
Mon 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 <html:form styleClass="frameCentrailAdminForm" action="/modifierLibelle" method="post"> <div id="contexte" style="display:none;"><%= request.getContextPath() %></div> <table class="style_catalogue"> <tr> <th> <bean:message bundle="admin" key="gestion.libelle.table.titre1" /> </th> </tr> <logic:iterate id="libelle" name="libellesForm" property="libelles" indexId="idx"> <tr> <td> <% String propriete = "libelles["+ idx +"].nom"; %> <html:text name="libellesForm" property="<%=propriete %>" /> </td> <logic:notEqual name="libelle" property="id" value="0"> <td class="col1" > <html:img style="cursor: pointer;" onclick="<%="confirmerSupprimLibelle(" + idx + ");" %>" pageKey="app.img.bouton.supprimer.commande" altKey="app.img.bouton.supprimer.libelle.support.alt" /> </td> </logic:notEqual> <td> <% String url = "/rechercheModule2?type=libelle&id="+ idx; %> <html:link action="<%=url %>" target="_blank"> Voir modules </html:link> </td> </tr> </logic:iterate> </table> </html:form>
C'est donc ma variable listeLibelles qui est toujours à null.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 forward=SUCCESS_VERSLIBELLE; System.out.println("############# liste module par libelle support"); String IDlibelle=(String)request.getParameter("id"); System.out.println("id libelle : " + IDlibelle); DynaValidatorForm dynaValidatorForm = (DynaValidatorForm) form; List listeLibelles= (List) dynaValidatorForm.get("libelles"); System.out.println("nom libelle : " + listeLibelles);
Et dans mon fichier de conf :
Avez vous une idée, je ne trouve pas d'où viens mon erreur.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 <form-bean name="libellesForm" type="org.apache.struts.validator.DynaValidatorForm"> <form-property name="libelles" type="java.util.List"/> </form-bean>
Merci
Partager