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

質問編集履歴

2

資料の追加

2020/08/19 11:16

投稿

senas.tt
senas.tt

スコア2

title CHANGED
File without changes
body CHANGED
@@ -2,7 +2,7 @@
2
2
  Spring Bootを使って、簡単な銭湯めぐりのWeb日記帳を制作しています。
3
3
  情報を表示する画面(show.html)から更新する画面(update.html)へと遷移したいのですが、
4
4
  どうも上手くいかず、エラー表示になってしまいます。
5
- show.htmlとコントローラーをチェックして頂きたいです。
5
+ show.htmlとupdate.html、コントローラーをチェックして頂きたいです。
6
6
 
7
7
 
8
8
 
@@ -20,7 +20,7 @@
20
20
 
21
21
  ### 該当のソースコード
22
22
 
23
- ```
23
+ ```html
24
24
  <!DOCTYPE html>
25
25
  <html xmlns:th="http://www.thymeleaf.org">
26
26
  <head>
@@ -39,7 +39,59 @@
39
39
  </body>
40
40
  </html>
41
41
  ```
42
+ ```html
43
+ <!DOCTYPE html>
44
+ <html xmlns:th="http://www.thymeleaf.org">
45
+ <head>
46
+ <meta charset="UTF-8">
47
+ <style type="text/css">
48
+ body {
49
+ font-family: monospace;
50
+ }
51
+
52
+ textarea {
53
+ vertical-align: middle
54
+ }
55
+ </style>
56
+ <title>更新</title>
57
+ </head>
58
+ <body>
59
+ <form th:action="@{/insert}" th:object="${form}" method="post">
60
+
61
+ <h3>施設名</h3>
62
+ <input type="text" name="name" th:value="*{name}" /><br>
63
+ <h3>場所</h3>
64
+ <input type="radio" name="location" th:value="東京都" />東京都<br>
65
+ <input type="radio" name="location" th:value="神奈川県" />神奈川県<br>
66
+ <input type="radio" name="location" th:value="埼玉県" />埼玉<br>
67
+ <input type="radio" name="location" th:value="千葉県" />千葉県<br>
68
+ <input type="radio" name="location" th:value="茨城県" />茨城県<br>
69
+ <input type="radio" name="location" th:value="群馬県"/>群馬県<br>
70
+ <input type="radio" name="location" th:value="栃木県" />栃木県<br>
71
+
72
+ <h3>ジャンル</h3>
73
+ <input type="checkbox" name="genre" th:value="近場" />近場<br>
74
+ <input type="checkbox" name="genre" th:value="遠出" />遠出<br>
75
+ <input type="checkbox" name="genre" th:value="車" />車<br>
76
+ <input type="checkbox" name="genre" th:value="電車" />電車<br>
77
+ <input type="checkbox" name="genre" th:value="大人数" />大人数<br>
78
+ <input type="checkbox" name="genre" th:value="個人" />個人<br>
79
+
80
+ <h3>評価</h3>
81
+ <input type="radio" name="reputation" th:value="3" />&#x1f60d;<br>
82
+ <input type="radio" name="reputation" th:value="2" />&#x1f642;<br>
83
+ <input type="radio" name="reputation" th:value="1" />&#x1f622;<br>
84
+ <br>
85
+ <h3>メモ</h3>
86
+ <textarea name="memo" th:text="*{memo}" cols="30" rows="5"
87
+ maxlength="400" placeholder="感想を記入"></textarea>
88
+ <input type="hidden" name="id" th:value="*{id}"/>
89
+ <br /> <a th:href="@{'/'}">トップへ</a> <input type="submit" value="更新する" />
90
+ </form>
91
+ </body>
92
+ </html>
42
93
  ```
94
+ ```java
43
95
  package com.example.demo;
44
96
 
45
97
  import java.util.List;

1

書式の改善

2020/08/19 11:16

投稿

senas.tt
senas.tt

スコア2

title CHANGED
File without changes
body CHANGED
@@ -39,7 +39,6 @@
39
39
  </body>
40
40
  </html>
41
41
  ```
42
-
43
42
  ```
44
43
  package com.example.demo;
45
44
 
@@ -103,6 +102,9 @@
103
102
  return mv;
104
103
  }
105
104
  }
105
+ ```
106
+
107
+
106
108
  ### 試したこと
107
109
  何度も自分なりに書き換えましたが、他の場所もエラーになる一方です。
108
110
  ### 補足情報(FW/ツールのバージョンなど)