Bonjour,
voilà j'ai besoin d'une solution pour pouvoir écrire une EL dans une autre EL.
dans mon mon controleur j'ai un modelAtrribute :
Dans ma jsp :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 @ModelAttribute("tablesContent") public HashMap<String, List> populateTablesContent() { HashMap<String, List> hm = new HashMap<String,List>(); hm.put("etudiant", etudiantService.getAllStudents()); hm.put("matiere", matiereService.getAllMatieres()); hm.put("examen", examenService.getAllExamens()); return hm; }
remarque : quand j'écris ${etud.fi} il me dit que l'attribut fi n'existe pas c'est à dire qu'il ne l'interprète pas
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 <c:forEach items="${tablesList}" var="table"> <tr> <td><form:checkbox path="tablesToTransfer" value="${table}" /></td> <td>${table}</td> </tr> <tr> <td></td> <td> <table> <tr> <c:forEach items="${fields[table]}" var="fi"> <td>${fi}</td> </c:forEach> </tr> <c:forEach items="${tablesContent[table]}" var="etud"> <tr> <c:forEach items="${fields[table]}" var="fi"> <td>${etud.${fi}}</td> </c:forEach> </tr> </c:forEach> </table> </td> </tr> </c:forEach>
Partager