Bonsoir,
Je souhaite afficher une liste de serveurs contenu dans une arraylist.
Pour cela j'utilise une variable de session ainsi qu'une Jsp mais cela ne fonctionne pas !!!
Voici mon code :
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 public class ListeCommandeAction extends ActionSupport implements SessionAware { /** * */ private static final long serialVersionUID = 1L; ModelCafe c; Map<String, Object> session; public String execute() throws Exception{ //assert((ModelCafe)getSession().get("cafe")!=null&&getSession().get("cafe").getClass()==ModelCafe.class); c=(ModelCafe)getSession().get("cafe"); if (c==null) { c = new ModelCafe(); getSession().put("cafe", c); } return SUCCESS; }
Merci d'avance pour votre aide !!!
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 <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <h4>Liste des boissons</h4> <table> <s:iterator value="#session.cafe"> <tr> <td><s:property value="numeroServeur" /></td> </tr> </s:iterator> </table> </body> </html>
Partager