HTMLテンプレートを使用して行テーブルのリストとして表示したい「製品」のリストがあります。
html テンプレートは次のようになります。
<tr th:fragment="productTemplate">
<td th:text="${productName}">product name</td>
<td th:text="${productprice}>product price</td>
</tr>
これが私がしたことです:
<table>
<tr th:each="product : ${products}" th:substituteby="product :: productTemplate" th:with="productName=*{name}, productPrice=*{price}" />
</table>
を 使用th:include
し た 場合 , それぞれ に 入れ子 が あり ます使用 し たtr
場合th:substituteby
, 代替 が 優先th:each
ループ項目を別のものに置き換える方法が見つかりません。
誰かがこれを行うための解決策を持っていますか?