• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts, probleme avec un arraylist dans un arraylist

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bonjour, j'ai du code qui mets un array d'items dans un arraylist<arraylist> simplement: (C'est un fichier .CSV, donc je veux le code 100% dynamique, je connais pas les noms des colons, je veux juste des cellule s�parar par le ;)

/***************************************************************************/
ArrayList<String> userList = new ArrayList<String>();
ArrayList<ArrayList<String>> userListArray = null ;
while ((line = bufRdr.readLine()) != null )
{
userListArray=new ArrayList<ArrayList<String>>();
st = new StringTokenizer(line,";");
while (st.hasMoreTokens()) /* looping on our columns, adding a new map each time */
{
userList.add(st.nextToken());
}
userListArray.add(userList);
}
request.setAttribute( "userListArray", userListArray);

//And so with struts i try to diplay it:
< logic:iterate id="userList" name="userListArray" type="java.util.ArrayList" >
<tr >
< logic:iterate id="users" name="userList" >
<td><bean:writename="users" /></ td >
</ logic:iterate >
</ tr >
</ logic:iterate >
/**********************************************************************************/
Apres ce code, j'ai l'information, mais tout sur 1 ligne, le double iteration ne marche pas, j'ai entendu qu'il faut utiliser "nested" mais comment faire dynamiquement? sans connaitre le nom du property?
Merci d'avance!
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"irelandsg irelandsg",
Welcome to JavaRanch!

We're pleased to have you here with us here on the ranch, but there are a few rules that need to be followed. One is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious. Initials are OK for the first and middle names but not the last. You can change it here


Also, please note. This is an English site.
If you don't fully trust language translation software and wish to post in your native language, you may do so but we require that there also be an English translation.

Thank you for your understanding.
-Ben

PS: We have a Struts specific forum. I'll move this thread to there for you.
[ July 22, 2008: Message edited by: Ben Souther ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic