0
我正在顯示如下的表格內容。尤其要注意如何*{id}
自動映射到row
內容:如何訪問百里香塊中的物體?
<table>
<tbody>
<th:block th:each="row : ${content}">
<tr th:object="${row}">
<td th:text="*{id}/>
<td th:text="${#temporals.format(row.thedate, 'yyyy-MM-dd HH:mm:ss')}">
2017-08-07 20:01:52</td>
</tr>
</th:block>
</tbody>
</table>
問:我怎麼可以重寫#temporals
表達也使用隱式引用到行?例如,下列不起作用:
<td th:text="${#temporals.format(*{thedate}, 'yyyy-MM-dd HH:mm:ss')}">
爲什麼*{thedate}
表達式在這裏不起作用?
你嘗試'日:with'? –
'th:with =「withdate = * {thedate}」'確實有效,但我希望在沒有'th:with'的情況下也能達到同樣的效果。 – membersound