tanakahdaのプログラマ手帳

プログラミングとかソフトウェア開発とかの備忘録

Velocity2.3でのループカウンター変数@Java

$velocityCountじゃなくて、$foreach.countや$foreach.indexを使う。

#foreach($object in $ $list)
    $foreach.count
#end
1 2 3

$foreach.indexの場合は、0からカウント