質問編集履歴
2
コントローラのリクエスト処理する関数の引数の型が誤っていました。MainForm → MainFormIfに修正。これでもダメでしたが
title
CHANGED
File without changes
|
body
CHANGED
@@ -42,7 +42,7 @@
|
|
42
42
|
}
|
43
43
|
|
44
44
|
@RequestMapping("/send")
|
45
|
-
public String send(@ModelAttribute("MainFormData")
|
45
|
+
public String send(@ModelAttribute("MainFormData") MainFormIf mainFormData) {
|
46
46
|
System.out.println(mainFormData.getBumon());
|
47
47
|
System.out.println(mainFormData.getTenpo());
|
48
48
|
|
1
web.xmlのソースを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -84,6 +84,24 @@
|
|
84
84
|
}
|
85
85
|
```
|
86
86
|
|
87
|
+
**web.xml**
|
88
|
+
```xml
|
89
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
90
|
+
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
91
|
+
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
92
|
+
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
93
|
+
id="WebApp_ID" version="3.1">
|
94
|
+
|
95
|
+
<!-- 一部のみ抜粋 -->
|
96
|
+
|
97
|
+
<servlet-mapping>
|
98
|
+
<servlet-name>dispatcherServlet</servlet-name>
|
99
|
+
<url-pattern>*.xhtml</url-pattern>
|
100
|
+
</servlet-mapping>
|
101
|
+
|
102
|
+
</web-app>
|
103
|
+
```
|
104
|
+
|
87
105
|
### 発生している問題・エラーメッセージ
|
88
106
|
MainCtrl.javaの@RequestMapping("/send")の箇所でMainFormから送信されてきたmainFormDataに何も入っていない状態です。(MainForm.htmlの時点ではth:valueに値はセットされているのですが)
|
89
107
|
|