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

質問編集履歴

4

ソース追加

2018/11/08 03:23

投稿

Nakataku
Nakataku

スコア15

title CHANGED
File without changes
body CHANGED
@@ -28,6 +28,23 @@
28
28
 
29
29
  ### 該当のソースコード
30
30
 
31
+
32
+
33
+ ```
34
+ <!DOCTYPE html>
35
+ <html lang="ja" xmlns:th="http://www.thymeleaf.org">
36
+ <head>
37
+ <meta charset="UTF-8">
38
+ <title>Sign in</title>
39
+ </head>
40
+ <body>
41
+ <h1>login</h1>
42
+
43
+ <a href="/signUp">sign up</a>
44
+
45
+ </body>
46
+ </html>
47
+ ```
31
48
  ```ここに言語名を入力
32
49
  <!DOCTYPE html>
33
50
  <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
@@ -46,21 +63,6 @@
46
63
  ```
47
64
 
48
65
  ```
49
- <!DOCTYPE html>
50
- <html lang="ja" xmlns:th="http://www.thymeleaf.org">
51
- <head>
52
- <meta charset="UTF-8">
53
- <title>Sign in</title>
54
- </head>
55
- <body>
56
- <h1>login</h1>
57
-
58
- <a href="/signUp">sign up</a>
59
-
60
- </body>
61
- </html>
62
- ```
63
- ```
64
66
  @Controller
65
67
  public class SignUpController {
66
68
 
@@ -76,7 +78,16 @@
76
78
  }
77
79
  ```
78
80
  ```
79
-
81
+ <!DOCTYPE html>
82
+ <html lang="en">
83
+ <head>
84
+ <meta charset="UTF-8">
85
+ <title>Sign up Confirm</title>
86
+ </head>
87
+ <body>
88
+ <h1>Sign Up Confirm</h1>
89
+ </body>
90
+ </html>
80
91
  ```
81
92
  ```
82
93
  package dev.create.form;

3

ソース修正

2018/11/08 03:23

投稿

Nakataku
Nakataku

スコア15

title CHANGED
File without changes
body CHANGED
@@ -69,43 +69,14 @@
69
69
  model.addAttribute("name","hogehoge");
70
70
  return "signUp";
71
71
  }
72
+ @RequestMapping(value = "signUpConfirm", method = RequestMethod.POST)
73
+ public String signUpConfirm(@ModelAttribute UserInfoForm userInfoForm, Model model){
74
+ return "signUpConfirm";
75
+ }
72
76
  }
73
77
  ```
74
78
  ```
75
- buildscript {
76
- ext {
77
- springBootVersion = '2.1.0.RELEASE'
78
- }
79
- repositories {
80
- mavenCentral()
81
- }
82
- dependencies {
83
- classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
84
- }
85
- }
86
79
 
87
- apply plugin: 'java'
88
- apply plugin: 'eclipse'
89
- apply plugin: 'org.springframework.boot'
90
- apply plugin: 'io.spring.dependency-management'
91
-
92
- group = 'div.create-resume'
93
- version = '0.0.1-SNAPSHOT'
94
- sourceCompatibility = 11
95
-
96
- repositories {
97
- mavenCentral()
98
- }
99
-
100
-
101
- dependencies {
102
- implementation('org.springframework.boot:spring-boot-starter-mail')
103
- implementation('org.springframework.boot:spring-boot-starter-thymeleaf')
104
- implementation('org.springframework.boot:spring-boot-starter-web')
105
- runtimeOnly('org.springframework.boot:spring-boot-devtools')
106
- runtimeOnly('mysql:mysql-connector-java')
107
- testImplementation('org.springframework.boot:spring-boot-starter-test')
108
- }
109
80
  ```
110
81
  ```
111
82
  package dev.create.form;

2

エラーメッセージ、formの追加

2018/11/08 03:21

投稿

Nakataku
Nakataku

スコア15

title CHANGED
File without changes
body CHANGED
@@ -8,59 +8,24 @@
8
8
  org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/signUp.html]")
9
9
  at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:241) ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]
10
10
  at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone(AbstractMarkupTemplateParser.java:100) ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]
11
- at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:666) ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]
12
- at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098) ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]
13
- at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072) ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]
14
- at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:362) ~[thymeleaf-spring5-3.0.11.RELEASE.jar:3.0.11.RELEASE]
15
- at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:189) ~[thymeleaf-spring5-3.0.11.RELEASE.jar:3.0.11.RELEASE]
16
- at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1370) ~[spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
17
- at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1116) ~[spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
18
- at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1055) ~[spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
19
- at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
20
- at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:998) ~[spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
21
- at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:890) ~[spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
22
- at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
23
- at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:875) ~[spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
24
- at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
25
- at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
26
- at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
27
- at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.12.jar:9.0.12]
28
- at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
29
- at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
30
- at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
31
- at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
32
- at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
33
- at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
34
- at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) ~[spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
35
- at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
36
- at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
37
- at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
38
- at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
39
- at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
40
- at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
41
- at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
42
- at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
43
- at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
44
- at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
45
- at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
46
- at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
47
- at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
48
- at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
49
- at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
50
- at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
51
- at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
52
- at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
53
- at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
54
- at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
55
- at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
56
- at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
57
- at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
58
- at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
59
- at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
60
- at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
61
- at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
62
11
  ```
12
+ ```
13
+ Caused by: org.attoparser.ParseException: Error during execution of processor 'org.thymeleaf.spring5.processor.SpringInputGeneralFieldTagProcessor' (template: "signUp" - line 9, col 28)
14
+ at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:393) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE]
15
+ at org.attoparser.MarkupParser.parse(MarkupParser.java:257) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE]
16
+ at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:230) ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]
17
+ ... 52 common frames omitted
18
+ ```
19
+ ```
20
+ Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Error during execution of processor 'org.thymeleaf.spring5.processor.SpringInputGeneralFieldTagProcessor' (template: "signUp" - line 9, col 28)
21
+ at org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess(AbstractAttributeTagProcessor.java:117) ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]
22
+ at org.thymeleaf.processor.element.AbstractElementTagProcessor.process(AbstractElementTagProcessor.java:95) ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]
23
+ ```
63
24
 
25
+ ```
26
+ Caused by: java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'userInfoForm' available as request attribute
27
+ ```
28
+
64
29
  ### 該当のソースコード
65
30
 
66
31
  ```ここに言語名を入力
@@ -141,4 +106,24 @@
141
106
  runtimeOnly('mysql:mysql-connector-java')
142
107
  testImplementation('org.springframework.boot:spring-boot-starter-test')
143
108
  }
109
+ ```
110
+ ```
111
+ package dev.create.form;
112
+
113
+ import javax.annotation.Resource;
114
+
115
+ @Resource
116
+ public class UserInfoForm {
117
+
118
+ private String userId = "";
119
+
120
+ public String getUserId() {
121
+ return userId;
122
+ }
123
+
124
+ public void setUserId(String userId) {
125
+ this.userId = userId;
126
+ }
127
+
128
+ }
144
129
  ```

1

gradleファイルもあげました

2018/11/08 02:56

投稿

Nakataku
Nakataku

スコア15

title CHANGED
File without changes
body CHANGED
@@ -105,4 +105,40 @@
105
105
  return "signUp";
106
106
  }
107
107
  }
108
+ ```
109
+ ```
110
+ buildscript {
111
+ ext {
112
+ springBootVersion = '2.1.0.RELEASE'
113
+ }
114
+ repositories {
115
+ mavenCentral()
116
+ }
117
+ dependencies {
118
+ classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
119
+ }
120
+ }
121
+
122
+ apply plugin: 'java'
123
+ apply plugin: 'eclipse'
124
+ apply plugin: 'org.springframework.boot'
125
+ apply plugin: 'io.spring.dependency-management'
126
+
127
+ group = 'div.create-resume'
128
+ version = '0.0.1-SNAPSHOT'
129
+ sourceCompatibility = 11
130
+
131
+ repositories {
132
+ mavenCentral()
133
+ }
134
+
135
+
136
+ dependencies {
137
+ implementation('org.springframework.boot:spring-boot-starter-mail')
138
+ implementation('org.springframework.boot:spring-boot-starter-thymeleaf')
139
+ implementation('org.springframework.boot:spring-boot-starter-web')
140
+ runtimeOnly('org.springframework.boot:spring-boot-devtools')
141
+ runtimeOnly('mysql:mysql-connector-java')
142
+ testImplementation('org.springframework.boot:spring-boot-starter-test')
143
+ }
108
144
  ```