Struts2 tag

johnjjj Messages postés 120 Date d'inscription dimanche 4 avril 2010 Statut Membre Dernière intervention 24 septembre 2012 - 14 sept. 2011 à 17:00
cs_Julien39 Messages postés 6414 Date d'inscription mardi 8 mars 2005 Statut Modérateur Dernière intervention 29 juillet 2020 - 24 sept. 2011 à 18:47
bonjour
je souhaite votre aide j'ai une list qui s'appelle nombre contient {a, b, c ,d e f g h, i, k}

a=nombre.size();
b=a%5;
if(b>0) c=(a/5)+1;
else c=a/5; 



<c:forEach begin="0" end="${c}"  ">


 
            

<s:iterator value="nomber " status="a" >
<s:property  />
</s:iterator >
 
               

Ggggggggggggggggggggggggggg1111111111

</c:forEach>

je souhaite afficher 5 par 5
exemple


a
b
c
d
e
Ggggggggggggggggggggggggggg1111111111

f
g
h
i
k
Ggggggggggggggggggggggggggg1111111111

merci

3 réponses

johnjjj Messages postés 120 Date d'inscription dimanche 4 avril 2010 Statut Membre Dernière intervention 24 septembre 2012
15 sept. 2011 à 02:14
par exemple si j'ai une list qui s'appelle listA
cette list contient {a, b, c ,d e f g h, i, k}
<c:forEach  var="list" items="${listA}"  > 
${list} </c:forEach>
bbbbbbbbbbbbbbbbbbbbbbbb


je souhaite afficher 5 par 5
résultat que je souhaite


abcde
bbbbbbbbbbbbbbbbbbbbbbbb
fghik

merci
0
johnjjj Messages postés 120 Date d'inscription dimanche 4 avril 2010 Statut Membre Dernière intervention 24 septembre 2012
15 sept. 2011 à 03:36
pour plus explication

je souhaite traduire ca on tag jstl avec une liste pas un tableau

String []tab={"a","z","e","r","t","y","u","i","o","p"};
for (int i=0; i<2;i++){
for(int j=i*5 ;j<(i*5)+5;j++)
{
System.out.println(tab[j]);

} System.out.println("aaaaaa"); }

}
}

merci
0
cs_Julien39 Messages postés 6414 Date d'inscription mardi 8 mars 2005 Statut Modérateur Dernière intervention 29 juillet 2020 371
24 sept. 2011 à 18:47
Bonjour,

Je suis désolé mais je ne comprend rien à ton problème...
0
Rejoignez-nous