Velocity templating in Java
Templates usually end with a .vm
See the official velocity website for downloads and documentation. The Velocity template language reference guide holds quick syntax information.
Velocity syntax notes - cheat sheet
Section titled “Velocity syntax notes - cheat sheet”Code snippets
Section titled “Code snippets”for each loop
Section titled “for each loop”#foreach($passenger in $booking.passengers)first name: $passenger.firstNamepassenger number: $velocityCount#endIn the above snippet, $velocityCount starts at 1, according to the user guide
you can alter this to start at 0 or 1, and you can also alter the variable name.