質問編集履歴
1
list.htmlの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -79,6 +79,7 @@
|
|
79
79
|
|
80
80
|
}
|
81
81
|
```
|
82
|
+
|
82
83
|
↓create.html (登録画面)
|
83
84
|
```html
|
84
85
|
<!DOCTYPE html>
|
@@ -106,6 +107,35 @@
|
|
106
107
|
</html>
|
107
108
|
```
|
108
109
|
|
110
|
+
↓list.html (顧客リスト表示画面)
|
111
|
+
```html
|
112
|
+
<!DOCTYPE html>
|
113
|
+
<html xmlns:th="http://www.thymeleaf.org">
|
114
|
+
<head>
|
115
|
+
<meta charset="UTF-8">
|
116
|
+
<title>顧客一覧</title>
|
117
|
+
</head>
|
118
|
+
<body>
|
119
|
+
<a th:href="@{/create}">顧客登録</a>
|
120
|
+
<hr>
|
121
|
+
<h1>顧客一覧</h1>
|
122
|
+
<table>
|
123
|
+
<tr>
|
124
|
+
<th>ID</th>
|
125
|
+
<th>名前</th>
|
126
|
+
<th>メールアドレス</th>
|
127
|
+
</tr>
|
128
|
+
|
129
|
+
<tr th:each="customer : ${customers}">
|
130
|
+
<td th:text="${customer.id}"></td>
|
131
|
+
<td th:text="${customer.name}"></td>
|
132
|
+
<td th:text="${customer.email}"></td>
|
133
|
+
</tr>
|
134
|
+
</table>
|
135
|
+
</body>
|
136
|
+
</html>
|
137
|
+
```
|
138
|
+
|
109
139
|
↓CustomerForm.java (入力内容を渡すクラス)
|
110
140
|
※@Dataアノテーションが上手く働いていないっぽいので、getter, setterを明示的に入れています。
|
111
141
|
```Java
|