OK, if you have to access the array items by index number then use the ListTool:
Make sure you have the latest tools jar. Then put: <tool> <key>list</key> <scope>application</scope> <class>org.apache.velocity.tools.generic.ListTool</class> </tool> into your toobox.xml Then you can do: #foreach ($array in $arrayList) #set($table1 = $list.get($array,0)) #set($table2 = $list.get($array,1)) #set($table3 = $list.get($array,2)) ## etc. #end The "$list" is the handle to access the ListTool functionality. Bill On 3/6/06, Rich Garabedian <[EMAIL PROTECTED]> wrote: > > Hey Bill. > > Thanks so much for the note. > > I don't think that code skeleton will for me because the objects in the > object array will be different. The List of object arrays is coming to me > from hibernate and in this particular scenario I'll have three different > beans. What I really want to do is something like this: > > #foreach ($array in $arrayList) > #set($table1 = $array.get(0)) > #set($table2 = $array.get(1)) > #set($table3 = $array.get(2)) > > ## Do stuff with $table1 > ## Do stuff with $table2 > ## Do stuff with $table3 > #end > > But I couldn't get that to work > > -----Original Message----- > From: Bill Rishel [mailto:[EMAIL PROTECTED] > Sent: Monday, March 06, 2006 3:06 PM > To: Velocity Users List; [EMAIL PROTECTED] > Subject: Re: List of Object Arrays > > #foreach ($array in $arrayList) > #foreach ($item in $array) > $item ## do something with $item > #end > #end > > > Bill > > > On 3/5/06, Rich Garabedian <[EMAIL PROTECTED]> wrote: > > > > Greetings Users List. > > > > Is there any way to loop through a List of Object Arrays in Velocity? In > > other words: > > > > Iterator i = myList.iterator(); > > > > while(i.hasNext()) > > { > > Object[] configArray = (Object[]) i.next(); > > > > //Do something with object array > > } > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >