DBからオブジェクトのリストを取得しています。ベロシティテンプレートを使用して、それらをhtmlテーブルに入力したいと思います。
<table>
<thead>
<tr>
<td>$value1 </td>
<td>$value2 </td>
</tr>
</thead>
<tbody>
<!-- Iterate through the list (List<SomeObject>) and display them here, -->
</tbody>
</table>
ヘッダーには、以下のコードを使用しています。
VelocityContext context = new VelocityContext();
context.put("value1", "text1");
context.put("value2", "text2");
以下のようにオブジェクトからデータを取得します。
List<SomeObject> obj = new ArrayList<SomeObject>();
obj.getItem1();
obj.getItem2();
個々のアイテムはすべて文字列です。テーブル本体のコンテンツを入力する方法は?