teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

型推論

2021/12/16 05:24

投稿

mpyw
mpyw

スコア5223

answer CHANGED
@@ -26,7 +26,7 @@
26
26
  1個目の記事より引用,少しアレンジ
27
27
 
28
28
  ```java
29
- List<Customer> customers = new ArrayList<Customer>();
29
+ var customers = new ArrayList<Customer>();
30
30
  customers.add(new Customer(1 , "Miura", "Kazuyoshi"));
31
31
  customers.add(new Customer(2 , "Kitazawa", "Tsuyoshi"));
32
32
  customers.add(new Customer(3 , "Hashiratani", "Tetsuji"));

1

簡易記法

2021/12/16 05:24

投稿

mpyw
mpyw

スコア5223

answer CHANGED
@@ -23,7 +23,7 @@
23
23
  - [Thymeleafチートシート - Qiita](https://qiita.com/NagaokaKenichi/items/c6d1b76090ef5ef39482)
24
24
  - [Loop through array in ThymeLeaf - Stack Overflow](https://stackoverflow.com/questions/24459936/loop-through-array-in-thymeleaf)
25
25
 
26
- 1個目の記事より引用
26
+ 1個目の記事より引用,少しアレンジ
27
27
 
28
28
  ```java
29
29
  List<Customer> customers = new ArrayList<Customer>();
@@ -35,8 +35,8 @@
35
35
 
36
36
  ```html
37
37
  <tr th:each="customer : ${customers}">
38
- <td th:text="${customer.id}"></td>
38
+ <td>[[${customer.id}]]</td>
39
- <td th:text="${customer.lastName}"></td>
39
+ <td>[[${customer.lastName}]]</td>
40
- <td th:text="${customer.firstName}"></td>
40
+ <td>[[${customer.firstName}]]</td>
41
41
  </tr>
42
42
  ```