質問編集履歴
1
web.xml
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#現状
|
2
|
-
『Spring Framework5-プログラミング入門-』掌田津耶乃 を用いてSpringを学習中なのですが、Bean構成クラスを作成し、ページを開いたところ404がでました。
|
2
|
+
『Spring Framework5-プログラミング入門-』掌田津耶乃 を用いてSpringを学習中なのですが、Bean構成クラスを作成し、web.xmlを変更してページを開いたところ404がでました。
|
3
3
|
ご教授よろしくお願いします。
|
4
|
+
|
4
5
|
###サーブレット
|
5
6
|
```
|
6
7
|
ackage mysample1;
|
@@ -73,23 +74,25 @@
|
|
73
74
|
}
|
74
75
|
|
75
76
|
```
|
76
|
-
###web.xml
|
77
|
+
###web.xml変更前
|
77
78
|
```
|
78
|
-
|
79
|
+
|
79
|
-
<param-name>contextClass</param-name>
|
80
|
-
<param-value>
|
81
|
-
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
|
82
|
-
</param-value>
|
83
|
-
</context-param>
|
84
80
|
<context-param>
|
85
|
-
<param-name>contextConfigLocation</param-name>
|
86
|
-
<param-value>mysample1.MyBeanConfig</param-value>
|
87
|
-
</context-param>
|
88
|
-
|
89
|
-
<!--
|
90
|
-
<context-param>
|
91
81
|
<param-name>contextConfigLocation</param-name>
|
92
82
|
<param-value>classpath:spring/application-config.xml</param-value>
|
93
83
|
</context-param>
|
84
|
+
|
85
|
+
```
|
86
|
+
###web.xml変更後
|
87
|
+
```
|
88
|
+
<context-param>
|
89
|
+
<param-name>contextClass</param-name>
|
94
|
-
|
90
|
+
<param-value>
|
91
|
+
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
|
92
|
+
</param-value>
|
93
|
+
</context-param>
|
94
|
+
<context-param>
|
95
|
+
<param-name>contextConfigLocation</param-name>
|
96
|
+
<param-value>mysample1.MyBeanConfig</param-value>
|
97
|
+
</context-param>
|
95
98
|
```
|