IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Servlets/JSP Java Discussion :

Problème d'affichage tableau en JSP


Sujet :

Servlets/JSP Java

  1. #1
    Membre chevronné
    Inscrit en
    Août 2010
    Messages
    416
    Détails du profil
    Informations forums :
    Inscription : Août 2010
    Messages : 416
    Par défaut Problème d'affichage tableau en JSP
    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

    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);
     
    		 }
     
    }
    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
     
     
      <body>
       <form name="form1" >
    <h3> Le taux de download en HTTP est :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br></h3> 
    <table width="501" border="1" align="left" height="69" style="width: 662px; height: 69px;">
    <tbody><tr>
     
    <td><font face="CG Omega">&nbsp;Heure&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br></font></td>
    <td>&nbsp;1</td>
    <td>&nbsp;2</td>
    <td>&nbsp;3</td>
    <td>&nbsp;4<br></td>
    <td>&nbsp;5</td>
    <td>&nbsp;6</td>
    <td>&nbsp;7</td>
    <td>&nbsp;8</td>
    <td>&nbsp;9</tr>
    <tr>
    <td><font face="CG Omega">Taux en Kb/s:&nbsp;</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>
    je ne sais pas comment exploiter les valeurs de mon tableau dans ma main Testperformance pour les afficher dans ce tableau, merci

  2. #2
    Membre averti
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    25
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 25
    Par défaut
    Bonjour,


    il te manque une servlet ou un controller spring.. ou tout autre qui te permettra d'envoyer a ta vue (ta jsp) les données de ton tableau.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Problème d'affichage tableau (array)
    Par flashnet dans le forum Langage
    Réponses: 6
    Dernier message: 03/11/2010, 22h39
  2. Problème d'affichage dans une JSP
    Par DomIII dans le forum Struts 1
    Réponses: 2
    Dernier message: 03/10/2008, 10h09
  3. Problème d'affichage d'une JSP et rafraichissement d'une page
    Par mega_info dans le forum Servlets/JSP
    Réponses: 5
    Dernier message: 05/10/2007, 15h37
  4. Réponses: 3
    Dernier message: 22/08/2007, 16h53
  5. [phpToPDF] Affichage tableau dynamique
    Par fat dans le forum Bibliothèques et frameworks
    Réponses: 17
    Dernier message: 23/05/2007, 16h19

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo