2017-08-14 10 views
0

私は次のようにテーブルの内容を表示しています。 *{id}rowコンテンツに自動的にマッピングし、特に注意してください:thymeleafブロックのオブジェクトにアクセスするには?

<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}式がここで働いていないのはなぜ?

+0

あなたは番目の 'てみました:WITH'を? –

+0

'th:with =" withdate = * {thedate} "'は本当に動作しますが、 'th:with'なしでこれを実現したいと思います。 – membersound

答えて

関連する問題