Bonjour à tous.

Bon alors voila, je ne suis pas depuis longtemps dans l'utilisation de Struts, j'ai pas non plus pour habitude de poster au moindre problème, mais là je ne trouve pas de réponse à mon problème.

Alors je vais essayer de synthétiser comme il se doit.

J'ai une page JSP avec deux listes et un bouton. Quand je clique sur le bouton je vais dans ma classe d'Action (Dispatch action vous comprendrez pourquoi ensuite)

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
public final ActionForward raffraichir(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request,
 final HttpServletResponse arg3) throws Exception {
		ConfigEntraideActionForm monForm = (ConfigEntraideActionForm) form;
		IEntraideManager entraideManager = new EntraideManager();
		Collection listeSiteFlux = entraideManager.getListeInfoEntraide(monForm.getEdg(), monForm.getIdFlux());
		monForm.setListeSiteFlux(listeSiteFlux);
		return mapping.getInputForward();
	}
Dans ce bout de code je récupère les infos selectionnées dans ces deux liste en je renvois le tout sur la même page.

Cette même page :

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
<html:form action="/configEntraide">
	<table class="tableGeneric" cellspacing="3" align="center">
		<html:hidden property="hidden" value="default" />
		<tr>
			<td>Entité de Gestion</td>
			<td><html:select property="edg">
				<html:optionsCollection property="listeEdg" value="edg" label="libelleComplet" />
			</html:select></td>
		</tr>
		<tr>
			<td>Flux</td>
			<td><html:select property="idFlux">
				<html:optionsCollection property="listeFlux" value="idFlux" label="libelleComplet" />
			</html:select></td>
		</tr>
		<tr>
			<td colspan="2" align="center"><html:submit onclick="javascript:setHidden('raffraichir');">Afficher</html:submit>
		</tr>
	</table>
	<logic:notEmpty name="ConfigEntraideActionForm"  property="listeSiteFlux" >
	<table>
	<logic:iterate name="ConfigEntraideActionForm" property="listeSiteFlux" id="SiteFlux" indexId="itt">
				<tr>
					<td><html:text name="SiteFlux" property="idSite" /></td>
					<td><html:text name="SiteFlux" property="idFlux" /></td>
					<td><html:text name="SiteFlux" property="flagMutu" /></td>
					<td><html:text name="SiteFlux" property="poidsAgent" /></td>
					<td><html:text name="SiteFlux" property="flagEntraidant" /></td>
					<td><html:text name="SiteFlux" property="seuil" /></td>
				</tr>
	</logic:iterate>
	</table>
	</logic:notEmpty>
	<html:submit onclick="javascript:setHidden('enregistrer');">Enregistrer</html:submit>
</html:form>
Donc suite au rafraichissment de la page je récupère cette liste d'objet info.

Je modifie un champs et je valide :

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 final ActionForward enregistrer(final ActionMapping mapping, final ActionForm form, 
final HttpServletRequest request, final HttpServletResponse arg3) throws Exception {
		try {
			ConfigEntraideActionForm monForm = (ConfigEntraideActionForm) form;
			IEntraideManager entraideManager = new EntraideManager();
			SiteFlux infos = null;
			Iterator listeSiteFlux = monForm.getListeSiteFlux().iterator();
			while (listeSiteFlux.hasNext()) {
				infos = (SiteFlux) listeSiteFlux.next();
				entraideManager.setInfosEntraide(infos);
			}
		} catch (Exception e) {
			logger.error(e);
		}
		return mapping.getInputForward();
	}
Mais voila le hic : listeSiteFlux est null.

Là je comprend pas. Pourtant au rafraichissement la liste est bien affichée