bonjour
j ai mon petit script dont je n arrive pas a déclarer un tableau:
code:
<%
FileReader lecteur = new FileReader(getServletContext().getRealPath("/")+"form/toto.txt");
BufferedReader bLecteur = new BufferedReader(lecteur);
String ligne = bLecteur.readLine();
String texte=new String();
String[] tableau;
String[] tabl;
String archives=new String();
String S_soustitre=new String();
int I_nbligne=0;
while (ligne != null) {
texte=texte+ligne+"&&";
ligne = bLecteur.readLine();
}
tableau=texte.split("&&");
for(int I_tableau=0;I_tableau<tableau.length-1;I_tableau++){
tabl=tableau[I_tableau].split("_");
}
S_soustitre=tabl[1];
int i =0;
for(i=0;i<tabl.length;i++){
while (I_nbligne!=(tabl.length-1)){
if (tabl[I_nbligne+1].compareTo(S_soustitre)==0)
archives=archives+"<li>"+tabl[I_nbligne+2]+"</li>" ;
I_nbligne++;
}
I_nbligne=0;
}
out.print(S_soustitre+"
");
out.print(archives);
%>
a ce passage ( texte en rose) tomcat me dit :
"variable tabl might not have been initialized"
merci de m'aider a declarer cette variable correctement ^^
Afficher la suite