質問編集履歴

4

不要なソースコード削除

2021/05/20 05:17

投稿

an_yuka09
an_yuka09

スコア1

test CHANGED
File without changes
test CHANGED
@@ -198,60 +198,6 @@
198
198
 
199
199
  ```
200
200
 
201
-
202
-
203
- ▼一覧画面(トップ画面)
204
-
205
- ```HTML
206
-
207
- <body>
208
-
209
- <h1>ユーザ一覧</h1>
210
-
211
- <a th:href="@{/users/create}">新規登録</a>
212
-
213
- </div>
214
-
215
-
216
-
217
- <table>
218
-
219
- <tr>
220
-
221
- <th></th>
222
-
223
- <th>ログインID</th>
224
-
225
- <th>氏名</th>
226
-
227
- <th>支店</th>
228
-
229
- <th>部署</th>
230
-
231
- <th>状態</th>
232
-
233
- </tr>
234
-
235
-
236
-
237
- <tr th:each="user: ${users}">
238
-
239
- <td><a th:href="@{/users/{id}/edit(id=*{id})}">編集</a></td>
240
-
241
- <td th:text="${user.login_id}"></td>
242
-
243
- <td th:text="${user.name}"></td>
244
-
245
- <td th:text="${user.branch_name}"></td>
246
-
247
- <td th:text="${user.position_name}"></td>
248
-
249
- <th:block th:switch = "${user.status}">
250
-
251
- (以下略)
252
-
253
- ```
254
-
255
201
  ### 試したこと
256
202
 
257
203
 

3

不要なソースコード削除

2021/05/20 05:17

投稿

an_yuka09
an_yuka09

スコア1

test CHANGED
File without changes
test CHANGED
@@ -108,200 +108,6 @@
108
108
 
109
109
 
110
110
 
111
- ▼Entity(Userクラス) ※追記
112
-
113
- ```Java
114
-
115
- public class User {
116
-
117
-
118
-
119
- private Long id;
120
-
121
-
122
-
123
- private String login_id;
124
-
125
-
126
-
127
- private String name;
128
-
129
-
130
-
131
- private String password;
132
-
133
-
134
-
135
- private int branch_id;
136
-
137
-
138
-
139
- private String branch_name;
140
-
141
-
142
-
143
- private int position_id;
144
-
145
-
146
-
147
- private String position_name;
148
-
149
-
150
-
151
- private int status;
152
-
153
-
154
-
155
-
156
-
157
- public Long getId() {
158
-
159
- return id;
160
-
161
- }
162
-
163
-
164
-
165
- public void setId(Long id) {
166
-
167
- this.id = id;
168
-
169
- }
170
-
171
-
172
-
173
- public String getLogin_id() {
174
-
175
- return login_id;
176
-
177
- }
178
-
179
-
180
-
181
- public void setLogin_id(String login_id) {
182
-
183
- this.login_id = login_id;
184
-
185
- }
186
-
187
-
188
-
189
- public String getName() {
190
-
191
- return name;
192
-
193
- }
194
-
195
-
196
-
197
- public void setName(String name) {
198
-
199
- this.name = name;
200
-
201
- }
202
-
203
-
204
-
205
- public String getPassword() {
206
-
207
- return password;
208
-
209
- }
210
-
211
-
212
-
213
- public void setPassword(String password) {
214
-
215
- this.password = password;
216
-
217
- }
218
-
219
-
220
-
221
- public int getBranch_id() {
222
-
223
- return branch_id;
224
-
225
- }
226
-
227
-
228
-
229
- public void setBranch_id(int branch_id) {
230
-
231
- this.branch_id = branch_id;
232
-
233
- }
234
-
235
-
236
-
237
- public String getBranch_name() {
238
-
239
- return branch_name;
240
-
241
- }
242
-
243
-
244
-
245
- public void setBranchName(String branch_name) {
246
-
247
- this.branch_name = branch_name;
248
-
249
- }
250
-
251
-
252
-
253
- public int getPosition_id() {
254
-
255
- return position_id;
256
-
257
- }
258
-
259
-
260
-
261
- public void setPosition_id(int position_id) {
262
-
263
- this.position_id = position_id;
264
-
265
- }
266
-
267
-
268
-
269
- public String getPosition_name() {
270
-
271
- return position_name;
272
-
273
- }
274
-
275
-
276
-
277
- public void setPositionName(String position_name) {
278
-
279
- this.position_name = position_name;
280
-
281
- }
282
-
283
-
284
-
285
- public int getStatus() {
286
-
287
- return status;
288
-
289
- }
290
-
291
-
292
-
293
- public void setStatus(int status) {
294
-
295
- this.status = status;
296
-
297
- }
298
-
299
- }
300
-
301
- ```
302
-
303
-
304
-
305
111
  ▼Mapper
306
112
 
307
113
  ```XML
@@ -394,130 +200,12 @@
394
200
 
395
201
 
396
202
 
397
- 入力フォーム ※追記
203
+ 一覧画面(トップ画面)
398
204
 
399
205
  ```HTML
400
206
 
401
207
  <body>
402
208
 
403
- <h1>ユーザ新規登録</h1>
404
-
405
-
406
-
407
- <form th:action="@{/users/create}" th:object="${form}" method="POST">
408
-
409
-
410
-
411
- <div class="form-row">
412
-
413
- <label for="login_id">ログインID</label>
414
-
415
- <input type="text" th:field="*{login_id}" />
416
-
417
- <div class="error" th:if="${#fields.hasErrors('login_id')}" th:errors="*{login_id}" style="color:red"></div>
418
-
419
- <div class="error" th:if="${#fields.hasErrors('loginIdCheck')}" th:errors="*{loginIdCheck}" style="color:red"></div>
420
-
421
- </div>
422
-
423
-
424
-
425
- <div class="form-row">
426
-
427
- <label for="name">お名前</label>
428
-
429
- <input type="text" th:field="*{name}" />
430
-
431
- <div class="error" th:if="${#fields.hasErrors('name')}" th:errors="*{name}" style="color:red"></div>
432
-
433
- </div>
434
-
435
-
436
-
437
- <div class="form-row">
438
-
439
- <label for="rawPassword">パスワード</label>
440
-
441
- <input type="password" th:field="*{rawPassword}" />
442
-
443
- <div class="error" th:if="${#fields.hasErrors('rawPassword')}" th:errors="*{rawPassword}" style="color:red"></div>
444
-
445
- </div>
446
-
447
-
448
-
449
- <div class="form-row">
450
-
451
- <label for="confirmPass">パスワード(確認用)</label>
452
-
453
- <input type="password" th:field="*{confirmPass}" />
454
-
455
- <div class="error" th:if="${#fields.hasErrors('confirmPass')}" th:errors="*{confirmPass}" style="color:red"></div>
456
-
457
- <div class="error" th:if="${#fields.hasErrors('passCheck')}" th:errors="*{passCheck}" style="color:red"></div>
458
-
459
- </div>
460
-
461
-
462
-
463
- <div class="form-row">
464
-
465
- <label for="branch_id">支社</label>
466
-
467
- <select name="branch_id">
468
-
469
- <option value="1">本社</option>
470
-
471
- <option value="2">支店A</option>
472
-
473
- <option value="3">支店B</option>
474
-
475
- <option value="4">支店C</option>
476
-
477
- </select>
478
-
479
- <div class="error"></div>
480
-
481
- </div>
482
-
483
-
484
-
485
- <div class="form-row">
486
-
487
- <label for="position_id">部署</label>
488
-
489
- <select name="position_id">
490
-
491
- <option value="1">営業部</option>
492
-
493
- <option value="2">総務部</option>
494
-
495
- <option value="3">経理部</option>
496
-
497
- </select>
498
-
499
- <div class="error"></div>
500
-
501
- </div>
502
-
503
- <input type="submit" value="登録">
504
-
505
- </form>
506
-
507
-
508
-
509
- <a th:href="@{/users}">戻る</a>
510
-
511
- </body>
512
-
513
- ```
514
-
515
- ▼一覧画面(トップ画面)
516
-
517
- ```HTML
518
-
519
- <body>
520
-
521
209
  <h1>ユーザ一覧</h1>
522
210
 
523
211
  <a th:href="@{/users/create}">新規登録</a>

2

ソースコード追記

2021/05/20 04:59

投稿

an_yuka09
an_yuka09

スコア1

test CHANGED
File without changes
test CHANGED
@@ -106,6 +106,202 @@
106
106
 
107
107
  ```
108
108
 
109
+
110
+
111
+ ▼Entity(Userクラス) ※追記
112
+
113
+ ```Java
114
+
115
+ public class User {
116
+
117
+
118
+
119
+ private Long id;
120
+
121
+
122
+
123
+ private String login_id;
124
+
125
+
126
+
127
+ private String name;
128
+
129
+
130
+
131
+ private String password;
132
+
133
+
134
+
135
+ private int branch_id;
136
+
137
+
138
+
139
+ private String branch_name;
140
+
141
+
142
+
143
+ private int position_id;
144
+
145
+
146
+
147
+ private String position_name;
148
+
149
+
150
+
151
+ private int status;
152
+
153
+
154
+
155
+
156
+
157
+ public Long getId() {
158
+
159
+ return id;
160
+
161
+ }
162
+
163
+
164
+
165
+ public void setId(Long id) {
166
+
167
+ this.id = id;
168
+
169
+ }
170
+
171
+
172
+
173
+ public String getLogin_id() {
174
+
175
+ return login_id;
176
+
177
+ }
178
+
179
+
180
+
181
+ public void setLogin_id(String login_id) {
182
+
183
+ this.login_id = login_id;
184
+
185
+ }
186
+
187
+
188
+
189
+ public String getName() {
190
+
191
+ return name;
192
+
193
+ }
194
+
195
+
196
+
197
+ public void setName(String name) {
198
+
199
+ this.name = name;
200
+
201
+ }
202
+
203
+
204
+
205
+ public String getPassword() {
206
+
207
+ return password;
208
+
209
+ }
210
+
211
+
212
+
213
+ public void setPassword(String password) {
214
+
215
+ this.password = password;
216
+
217
+ }
218
+
219
+
220
+
221
+ public int getBranch_id() {
222
+
223
+ return branch_id;
224
+
225
+ }
226
+
227
+
228
+
229
+ public void setBranch_id(int branch_id) {
230
+
231
+ this.branch_id = branch_id;
232
+
233
+ }
234
+
235
+
236
+
237
+ public String getBranch_name() {
238
+
239
+ return branch_name;
240
+
241
+ }
242
+
243
+
244
+
245
+ public void setBranchName(String branch_name) {
246
+
247
+ this.branch_name = branch_name;
248
+
249
+ }
250
+
251
+
252
+
253
+ public int getPosition_id() {
254
+
255
+ return position_id;
256
+
257
+ }
258
+
259
+
260
+
261
+ public void setPosition_id(int position_id) {
262
+
263
+ this.position_id = position_id;
264
+
265
+ }
266
+
267
+
268
+
269
+ public String getPosition_name() {
270
+
271
+ return position_name;
272
+
273
+ }
274
+
275
+
276
+
277
+ public void setPositionName(String position_name) {
278
+
279
+ this.position_name = position_name;
280
+
281
+ }
282
+
283
+
284
+
285
+ public int getStatus() {
286
+
287
+ return status;
288
+
289
+ }
290
+
291
+
292
+
293
+ public void setStatus(int status) {
294
+
295
+ this.status = status;
296
+
297
+ }
298
+
299
+ }
300
+
301
+ ```
302
+
303
+
304
+
109
305
  ▼Mapper
110
306
 
111
307
  ```XML
@@ -198,7 +394,7 @@
198
394
 
199
395
 
200
396
 
201
- ▼入力フォーム
397
+ ▼入力フォーム ※追記
202
398
 
203
399
  ```HTML
204
400
 
@@ -218,9 +414,9 @@
218
414
 
219
415
  <input type="text" th:field="*{login_id}" />
220
416
 
221
- <div class="invalid-feedback" th:if="${#fields.hasErrors('login_id')}" th:errors="*{login_id}" style="color:red"></div>
417
+ <div class="error" th:if="${#fields.hasErrors('login_id')}" th:errors="*{login_id}" style="color:red"></div>
222
-
418
+
223
- <div class="feedback-area invalid-feedback" th:if="${#fields.hasErrors('loginIdCheck')}" th:errors="*{loginIdCheck}" style="color:red"></div>
419
+ <div class="error" th:if="${#fields.hasErrors('loginIdCheck')}" th:errors="*{loginIdCheck}" style="color:red"></div>
224
420
 
225
421
  </div>
226
422
 
@@ -232,7 +428,7 @@
232
428
 
233
429
  <input type="text" th:field="*{name}" />
234
430
 
235
- <div class="invalid-feedback" th:if="${#fields.hasErrors('name')}" th:errors="*{name}" style="color:red"></div>
431
+ <div class="error" th:if="${#fields.hasErrors('name')}" th:errors="*{name}" style="color:red"></div>
236
432
 
237
433
  </div>
238
434
 
@@ -244,7 +440,7 @@
244
440
 
245
441
  <input type="password" th:field="*{rawPassword}" />
246
442
 
247
- <div class="invalid-feedback" th:if="${#fields.hasErrors('rawPassword')}" th:errors="*{rawPassword}" style="color:red"></div>
443
+ <div class="error" th:if="${#fields.hasErrors('rawPassword')}" th:errors="*{rawPassword}" style="color:red"></div>
248
444
 
249
445
  </div>
250
446
 
@@ -256,9 +452,9 @@
256
452
 
257
453
  <input type="password" th:field="*{confirmPass}" />
258
454
 
259
- <div class="invalid-feedback" th:if="${#fields.hasErrors('confirmPass')}" th:errors="*{confirmPass}" style="color:red"></div>
455
+ <div class="error" th:if="${#fields.hasErrors('confirmPass')}" th:errors="*{confirmPass}" style="color:red"></div>
260
-
456
+
261
- <div class="feedback-area invalid-feedback" th:if="${#fields.hasErrors('passCheck')}" th:errors="*{passCheck}" style="color:red"></div>
457
+ <div class="error" th:if="${#fields.hasErrors('passCheck')}" th:errors="*{passCheck}" style="color:red"></div>
262
458
 
263
459
  </div>
264
460
 
@@ -280,7 +476,7 @@
280
476
 
281
477
  </select>
282
478
 
283
- <div class="invalid-feedback"></div>
479
+ <div class="error"></div>
284
480
 
285
481
  </div>
286
482
 
@@ -300,7 +496,7 @@
300
496
 
301
497
  </select>
302
498
 
303
- <div class="invalid-feedback"></div>
499
+ <div class="error"></div>
304
500
 
305
501
  </div>
306
502
 

1

ソースコード追記

2021/05/20 01:34

投稿

an_yuka09
an_yuka09

スコア1

test CHANGED
File without changes
test CHANGED
@@ -196,6 +196,126 @@
196
196
 
197
197
  ```
198
198
 
199
+
200
+
201
+ ▼入力フォーム
202
+
203
+ ```HTML
204
+
205
+ <body>
206
+
207
+ <h1>ユーザ新規登録</h1>
208
+
209
+
210
+
211
+ <form th:action="@{/users/create}" th:object="${form}" method="POST">
212
+
213
+
214
+
215
+ <div class="form-row">
216
+
217
+ <label for="login_id">ログインID</label>
218
+
219
+ <input type="text" th:field="*{login_id}" />
220
+
221
+ <div class="invalid-feedback" th:if="${#fields.hasErrors('login_id')}" th:errors="*{login_id}" style="color:red"></div>
222
+
223
+ <div class="feedback-area invalid-feedback" th:if="${#fields.hasErrors('loginIdCheck')}" th:errors="*{loginIdCheck}" style="color:red"></div>
224
+
225
+ </div>
226
+
227
+
228
+
229
+ <div class="form-row">
230
+
231
+ <label for="name">お名前</label>
232
+
233
+ <input type="text" th:field="*{name}" />
234
+
235
+ <div class="invalid-feedback" th:if="${#fields.hasErrors('name')}" th:errors="*{name}" style="color:red"></div>
236
+
237
+ </div>
238
+
239
+
240
+
241
+ <div class="form-row">
242
+
243
+ <label for="rawPassword">パスワード</label>
244
+
245
+ <input type="password" th:field="*{rawPassword}" />
246
+
247
+ <div class="invalid-feedback" th:if="${#fields.hasErrors('rawPassword')}" th:errors="*{rawPassword}" style="color:red"></div>
248
+
249
+ </div>
250
+
251
+
252
+
253
+ <div class="form-row">
254
+
255
+ <label for="confirmPass">パスワード(確認用)</label>
256
+
257
+ <input type="password" th:field="*{confirmPass}" />
258
+
259
+ <div class="invalid-feedback" th:if="${#fields.hasErrors('confirmPass')}" th:errors="*{confirmPass}" style="color:red"></div>
260
+
261
+ <div class="feedback-area invalid-feedback" th:if="${#fields.hasErrors('passCheck')}" th:errors="*{passCheck}" style="color:red"></div>
262
+
263
+ </div>
264
+
265
+
266
+
267
+ <div class="form-row">
268
+
269
+ <label for="branch_id">支社</label>
270
+
271
+ <select name="branch_id">
272
+
273
+ <option value="1">本社</option>
274
+
275
+ <option value="2">支店A</option>
276
+
277
+ <option value="3">支店B</option>
278
+
279
+ <option value="4">支店C</option>
280
+
281
+ </select>
282
+
283
+ <div class="invalid-feedback"></div>
284
+
285
+ </div>
286
+
287
+
288
+
289
+ <div class="form-row">
290
+
291
+ <label for="position_id">部署</label>
292
+
293
+ <select name="position_id">
294
+
295
+ <option value="1">営業部</option>
296
+
297
+ <option value="2">総務部</option>
298
+
299
+ <option value="3">経理部</option>
300
+
301
+ </select>
302
+
303
+ <div class="invalid-feedback"></div>
304
+
305
+ </div>
306
+
307
+ <input type="submit" value="登録">
308
+
309
+ </form>
310
+
311
+
312
+
313
+ <a th:href="@{/users}">戻る</a>
314
+
315
+ </body>
316
+
317
+ ```
318
+
199
319
  ▼一覧画面(トップ画面)
200
320
 
201
321
  ```HTML