質問編集履歴
1
コントローラークラス及びエラー文の掲載
test
CHANGED
File without changes
|
test
CHANGED
@@ -64,4 +64,162 @@
|
|
64
64
|
|
65
65
|
|
66
66
|
|
67
|
-
|
67
|
+
## LoginController.java
|
68
|
+
|
69
|
+
```Java
|
70
|
+
|
71
|
+
package com.example.demo.login.controller;
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
import org.springframework.stereotype.Controller;
|
76
|
+
|
77
|
+
import org.springframework.ui.Model;
|
78
|
+
|
79
|
+
import org.springframework.web.bind.annotation.GetMapping;
|
80
|
+
|
81
|
+
import org.springframework.web.bind.annotation.PostMapping;
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
@Controller
|
86
|
+
|
87
|
+
public class LoginController {
|
88
|
+
|
89
|
+
@GetMapping("/login")
|
90
|
+
|
91
|
+
public String getLogin(Model model) {
|
92
|
+
|
93
|
+
return "login/login";
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
@PostMapping("/login")
|
100
|
+
|
101
|
+
public String postLogin(Model model) {
|
102
|
+
|
103
|
+
return "login/login";
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
}
|
108
|
+
|
109
|
+
```
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
## SignupController
|
114
|
+
|
115
|
+
```Java
|
116
|
+
|
117
|
+
package com.example.demo.login.controller;
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
import java.util.LinkedHashMap;
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
import java.util.Map;
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
import org.springframework.stereotype.Controller;
|
130
|
+
|
131
|
+
import org.springframework.ui.Model;
|
132
|
+
|
133
|
+
import org.springframework.validation.BindingResult;
|
134
|
+
|
135
|
+
import org.springframework.validation.annotation.Validated;
|
136
|
+
|
137
|
+
import org.springframework.web.bind.annotation.GetMapping;
|
138
|
+
|
139
|
+
import org.springframework.web.bind.annotation.ModelAttribute;
|
140
|
+
|
141
|
+
import org.springframework.web.bind.annotation.PostMapping;
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
import com.example.demo.login.domain.model.GroupOrder;
|
146
|
+
|
147
|
+
import com.example.demo.login.domain.model.SignupForm;
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
@Controller
|
152
|
+
|
153
|
+
public class SignupController {
|
154
|
+
|
155
|
+
private Map<String, String> radioMarriage;
|
156
|
+
|
157
|
+
private Map<String, String> initRadioMarriage(){
|
158
|
+
|
159
|
+
Map<String, String> radio = new LinkedHashMap<>();
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
radio.put("既婚", "true");
|
164
|
+
|
165
|
+
radio.put("未婚", "false");
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
return radio;
|
170
|
+
|
171
|
+
}
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
@GetMapping("/signup")
|
176
|
+
|
177
|
+
public String getSignUp(@ModelAttribute SignupForm form, Model model) {
|
178
|
+
|
179
|
+
radioMarriage = initRadioMarriage();
|
180
|
+
|
181
|
+
model.addAttribute("radioMarriage", radioMarriage);
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
return "login/signup";
|
186
|
+
|
187
|
+
}
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
@PostMapping("/signup")
|
192
|
+
|
193
|
+
public String postSignUp(@ModelAttribute @Validated(GroupOrder.class) SignupForm form, BindingResult bindingResult, Model model) {
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
if(bindingResult.hasErrors()) {
|
198
|
+
|
199
|
+
return getSignUp(form, model);
|
200
|
+
|
201
|
+
}
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
System.out.println(form);
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
return "redirect:/login";
|
210
|
+
|
211
|
+
}
|
212
|
+
|
213
|
+
}
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
```
|
218
|
+
|
219
|
+
##エラー(文字数制限のため一部)
|
220
|
+
|
221
|
+
> org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'projectingArgumentResolverBeanPostProcessor' defined in class path resource [org/springframework/data/web/config/ProjectingArgumentResolverRegistrar.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting 'name pattern' at character position 70
|
222
|
+
|
223
|
+
execution(*com.example.demo.login.controller.LoginController.getLogin(..))
|
224
|
+
|
225
|
+
^
|