You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Colin Chalmers <co...@maxware.nl> on 2003/01/09 17:41:44 UTC

Getting an object from a List

Hi,

I'm sending an Object to the template which has a method which in turn returns a List of other Objects. I'm trying to get this first Object of that List via the method but am having some probs. 

What am I doing wrong? Any help apprciated.

For example

#foreach ($Obj in $ObjEntries)
  
   #set( $foo = $Obj.getFoos().get(0) )

    //Do something with $foo
#end

/c