Bonjour, je veux afficher un tableau dans ma page JSP, j'ai crée un tableau HTML dans ma page, les input ect....mais j'arrive pas à le remplir: voila ma fonction qui fait du calcul periodique et le stocke dans un tableau
et voila ma page JSP :
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53 package marouene; import java.util.Timer; import java.util.TimerTask; public class TestPerformance { static int i = 0; static Timer timer; static double[] tableauftp = new double[10]; static double[] tableauhttp = new double[10]; public static void main(String[] args) { Webbrowing web = new Webbrowing(); System.out.println("Temps de réponse webbrowsing en ms = " +web.Webtime()); class RemindTask extends TimerTask { public void run() { TestFtp ftp = new TestFtp(); HttpClient http = new HttpClient(); System.out.println("debit ftp = " +ftp.calculdebitftp()); System.out.println("debit http = " +http.debithttp()); //timer.cancel(); //Not necessary because we call System.exit // System.exit(0); //Stops the AWT thread (and everything else) tableauftp[i]=ftp.calculdebitftp(); tableauhttp[i]=http.debithttp(); i = i +1; if (i==11) { i=0; } } } timer = new Timer(); timer.scheduleAtFixedRate(new RemindTask(), 0, 5 * 1000); } }
je ne sais pas comment exploiter les valeurs de mon tableau dans ma main Testperformance pour les afficher dans ce tableau, merci
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
36
37
38
39
40 <body> <form name="form1" > <h3> Le taux de download en HTTP est : <br></h3> <table width="501" border="1" align="left" height="69" style="width: 662px; height: 69px;"> <tbody><tr> <td><font face="CG Omega"> Heure <br></font></td> <td> 1</td> <td> 2</td> <td> 3</td> <td> 4<br></td> <td> 5</td> <td> 6</td> <td> 7</td> <td> 8</td> <td> 9</tr> <tr> <td><font face="CG Omega">Taux en Kb/s: </font><font face="CG Omega"> <br></font></td> <td><input type="text" name="21" size="8"></td> <td><input type="text" name="22" size="8"></td> <td><input type="text" name="23" size="8"></td> <td><input type="text" name="24" size="8"></td> <td><input type="text" name="25" size="8"></td> <td><input type="text" name="26" size="8"></td> <td><input type="text" name="27" size="8"></td> <td><input type="text" name="28" size="8"></td> <td><input type="text" name="29" size="8"></td></tr> </tbody></table> </div></form> </body> </html>
Partager