質問編集履歴

3

依頼のあったコードを掲示しました。

2019/08/14 08:55

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -68,6 +68,8 @@
68
68
 
69
69
 
70
70
 
71
+
72
+
71
73
  import java.util.Optional;
72
74
 
73
75
 
@@ -274,7 +276,7 @@
274
276
 
275
277
  d1.setMail("syoda@tuyano");
276
278
 
277
- d1.setMemo("this is my data");
279
+ d1.setMemo("09099994444");
278
280
 
279
281
  repository.saveAndFlush(d1);
280
282
 
@@ -290,7 +292,7 @@
290
292
 
291
293
  d2.setMail("gorilla227naoki@gmail.com");
292
294
 
293
- d2.setMemo("I learn springboot");
295
+ d2.setMemo("070498394222");
294
296
 
295
297
  repository.saveAndFlush(d2);
296
298
 
@@ -308,7 +310,7 @@
308
310
 
309
311
  d3.setMail("sachiko@happy");
310
312
 
311
- d3.setMemo("my work friend...");
313
+ d3.setMemo("09099996767");
312
314
 
313
315
  repository.saveAndFlush(d3);
314
316
 
@@ -322,8 +324,6 @@
322
324
 
323
325
 
324
326
 
325
-
326
-
327
327
  ```
328
328
 
329
329
 
@@ -368,6 +368,8 @@
368
368
 
369
369
  td{padding:5px; color:black; background:#f0f0f0f;}
370
370
 
371
+ .err{color:red;}
372
+
371
373
  </style>
372
374
 
373
375
  </head>
@@ -422,22 +424,20 @@
422
424
 
423
425
  <tr>
424
426
 
425
- <td><label for="memo">メモ</label></td>
427
+ <td><label for="memo">メモ</label></td>
428
+
429
+ <td><textarea name="memo" th:value="*{memo}" cols="20" rows="5"></textarea>
430
+
431
+ <div th:if="${#fields.hasErrors('memo')}" th:errors="*{memo}" th:errorclass="err"></div></td>
432
+
433
+ </tr><td></td><tr>
426
434
 
427
435
  <td>
428
436
 
429
- <textarea name="memo" th:value="*{memo}" cols="20" rows="5"></textarea>
437
+ <input type="submit"/>
430
438
 
431
439
  </td>
432
440
 
433
- </tr><td></td><tr>
434
-
435
- <td>
436
-
437
- <input type="submit"/>
438
-
439
- </td>
440
-
441
441
  </tr>
442
442
 
443
443
  </form>
@@ -474,13 +474,139 @@
474
474
 
475
475
 
476
476
 
477
-
477
+ messages.properties
478
+
478
-
479
+ ```
480
+
479
-
481
+ content.title=this is sample page!
482
+
480
-
483
+ ```
484
+
481
-
485
+ pom.xml
486
+
482
-
487
+ ```xml
488
+
483
-
489
+ <?xml version="1.0" encoding="UTF-8"?>
490
+
491
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
492
+
493
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
494
+
495
+ <modelVersion>4.0.0</modelVersion>
496
+
497
+ <parent>
498
+
499
+ <groupId>org.springframework.boot</groupId>
500
+
501
+ <artifactId>spring-boot-starter-parent</artifactId>
502
+
503
+ <version>2.1.7.RELEASE</version>
504
+
505
+ <relativePath/> <!-- lookup parent from repository -->
506
+
507
+ </parent>
508
+
509
+ <groupId>com.tuyano.springboot</groupId>
510
+
511
+ <artifactId>MyBootApp</artifactId>
512
+
513
+ <version>0.0.1-SNAPSHOT</version>
514
+
515
+ <name>MyBootApp</name>
516
+
517
+ <description>Sample project for Spring Boot</description>
518
+
519
+
520
+
521
+ <properties>
522
+
523
+ <java.version>1.8</java.version>
524
+
525
+ </properties>
526
+
527
+
528
+
529
+ <dependencies>
530
+
531
+ <dependency>
532
+
533
+ <groupId>org.springframework.boot</groupId>
534
+
535
+ <artifactId>spring-boot-starter-data-jpa</artifactId>
536
+
537
+ </dependency>
538
+
539
+ <dependency>
540
+
541
+ <groupId>org.springframework.boot</groupId>
542
+
543
+ <artifactId>spring-boot-starter-web</artifactId>
544
+
545
+ </dependency>
546
+
547
+
548
+
549
+ <dependency>
550
+
551
+ <groupId>com.h2database</groupId>
552
+
553
+ <artifactId>h2</artifactId>
554
+
555
+ <scope>runtime</scope>
556
+
557
+ </dependency>
558
+
559
+ <dependency>
560
+
561
+ <groupId>org.springframework.boot</groupId>
562
+
563
+ <artifactId>spring-boot-starter-test</artifactId>
564
+
565
+ <scope>test</scope>
566
+
567
+ </dependency>
568
+
569
+ <dependency>
570
+
571
+ <groupId>org.springframework.boot</groupId>
572
+
573
+ <artifactId>spring-boot-starter-thymeleaf</artifactId>
574
+
575
+ </dependency>
576
+
577
+ </dependencies>
578
+
579
+
580
+
581
+ <build>
582
+
583
+ <plugins>
584
+
585
+ <plugin>
586
+
587
+ <groupId>org.springframework.boot</groupId>
588
+
589
+ <artifactId>spring-boot-maven-plugin</artifactId>
590
+
591
+ </plugin>
592
+
593
+ </plugins>
594
+
595
+ </build>
596
+
597
+
598
+
599
+ </project>
600
+
601
+
602
+
603
+ ```
604
+
605
+
606
+
607
+ 構成
608
+
609
+ ![![イメージ説明](d69f3c08b2ac011b0643b368150590db.png)](9d6af98677ba790beabe4f78c376740c.png)
484
610
 
485
611
 
486
612
 

2

タグを追加しました。

2019/08/14 08:55

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
File without changes

1

タイプミスを訂正しました。

2019/08/14 03:31

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  テキストを用いて学習をしているのですが、
10
10
 
11
- mavenベースのプロジェクトでプロパティファイルmessages_ja.propatiesからテキストを読み込んで、表示しようとしています。
11
+ mavenベースのプロジェクトでプロパティファイルmessages_ja.propertiesからテキストを読み込んで、表示しようとしています。
12
12
 
13
13
 
14
14