[Struts-Layout] collection comment récupérer mes données
J'ai un tableau de collection dont voici le code:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <layout:collection property="allCalendriers" align="center" styleClass="ligneClaire" styleClass2="ligneFonce" width="100%">
<layout:collectionTitle title=""styleClass="intituleTableau police">
<layout:collectionItem styleClass="center" width="500px"title="" property="idCommission" />
</layout:collectionTitle>
<layout:collectionTitle title="campagne.libelle.limite.validation.pole" styleClass="intituleTableau police">
<layout:collectionInput title="" property="stringDateLimiteSaisie" formProperty="stringDateLimiteSaisie" />
</layout:collectionTitle>
<layout:collectionTitle title="campagne.libelle.edition.odj" styleClass="intituleTableau police">
<layout:collectionInput title="" property="stringDateEditOdj" formProperty="stringDateEditOdj"/>
</layout:collectionTitle>
<layout:collectionTitle title="campagne.libelle.commission" styleClass="intituleTableau police">
<layout:collectionInput title="" property="stringDateDateCommission" formProperty="stringDateDateCommission"/>
</layout:collectionTitle>
<layout:collectionTitle title="campagne.libelle.disponibilite" styleClass="intituleTableau police">
<layout:collectionInput title="" property="stringDateAvis" formProperty="stringDateAvis"/>
</layout:collectionTitle>
<layout:collectionTitle title="campagne.libelle.limite.edition.pv" styleClass="intituleTableau police">
<layout:collectionInput title="" property="stringDateEditPv" formProperty="stringDateEditPv"/>
</layout:collectionTitle>
</layout:collection> |
J'ai un formBean avec les attributs suivants
Code:
1 2 3 4 5 6 7 8 9
| public class CalendrierCommissionFormBean extends ValidatorActionForm {
private Long id = new Long (-1);
private List allCalendriers;
private String dateRef;
private String dateDemarrage;
private String dateLimiteValidation;
private String dateLimiteDotation;
private String dateDemarrageProposition;
private String dateExportSap; |
les getteurs et les setteurs qui vont bien.
Mais lorque je veux envoyer via un form j'ai l'erreur suivante:
Citation:
org.apache.struts.action.RequestProcessor Unhandled Exception thrown: class java.lang.NullPointerException
[04/06/07 18:13:37:039 CEST] 73ffc054 WebGroup E SRVE0026E: [Erreur de servlet]-[]: java.lang.NullPointerException
at fr.cea.saclay.dti.gdai.action.calendrier.CalendrierCommissionAction.doSave(CalendrierCommissionAction.java:139)
at fr.cea.saclay.dti.gdai.action.GdaiAction.execute(GdaiAction.java:46)
l'erreur me renvoie à la ligne suivante:
Code:
Iterator iter= monForm.getAllCalendriers().iterator();
et la méthode getAllCalendriers est écrite dans mon form bean comme suit
Code:
1 2 3 4
| public List getAllCalendriers()
{
return allCalendriers;
} |
dernière remarque, lorsque je lis le code de ma page je ne trouve pas trace de allCalendriers comme le prouve mon extrait suivant:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| tr valign="top"><th class="intituleTableau police"></th><th class="intituleTableau police">Date limite de validation pôle</th><th class="intituleTableau police">Edition ODJ</th><th class="intituleTableau police">Commission</th><th class="intituleTableau police">Disponibilité des notifications</th><th class="intituleTableau police">Edition du pv</th></tr>
<tr valign="top"><th class="center" width="500px"></th><th class="ligneClaire"></th><th class="ligneClaire"></th><th class="ligneClaire"></th><th class="ligneClaire"></th><th class="ligneClaire"></th></tr>
<tr>
<td class="center">1</td>
<td class="ligneFonce"><input type="text" name="stringDateLimiteSaisie[0]" value=""></td>
<td class="ligneFonce"><input type="text" name="stringDateEditOdj[0]" value=""></td>
<td class="ligneFonce"><input type="text" name="stringDateDateCommission[0]" value=""></td>
<td class="ligneFonce"><input type="text" name="stringDateAvis[0]" value=""></td>
<td class="ligneFonce"><input type="text" name="stringDateEditPv[0]" value=""></td>
</tr><tr>
<td class="center">2</td>
<td class="ligneClaire"><input type="text" name="stringDateLimiteSaisie[1]" value=""></td>
<td class="ligneClaire"><input type="text" name="stringDateEditOdj[1]" value=""></td> |
Voila si quelqu'un à une idée, je suis preneur. En plus je suis sur que c'est une bétise....