Velocity DisplayTool has a useful method:
$display.list($list)
That will format a collection or array into the form "A, B and C".
The problem is lets say I have an ArrayList of objects, how do I output a specific object field instead of the whole object? For example the regular loop would look like this:
#foreach($obj in $list)
${obj.title}
#end
For now I just made obj.toString() to return obj.title, but what if I will need another field?
Thanks.
UPDATE Ended up implementing this method myself and committing it to DisplayTools. So it is a part of Tools 2.0 now.