質問編集履歴

2

2018/11/08 01:33

投稿

mk222222
mk222222

スコア59

test CHANGED
File without changes
test CHANGED
@@ -49,3 +49,63 @@
49
49
  jspのヘッダーのincludeをしたかった感じです。
50
50
 
51
51
  できないならひとつひとつincludeします、、
52
+
53
+
54
+
55
+ 補足
56
+
57
+ 一番上の方法もできませんでした
58
+
59
+ エラー内容
60
+
61
+ Line 5 in XML document from class path resource [web.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 16; cvc-elt.1: 要素'web-app'の宣言が見つかりません。
62
+
63
+ エラー内容
64
+
65
+ ```ここに言語を入力
66
+
67
+ <?xml version="1.0" encoding="UTF-8"?>
68
+
69
+ <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
70
+
71
+ xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:jsp="http://java.sun.com/xml/ns/javaee/jsp"
72
+
73
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
74
+
75
+ version="3.1">
76
+
77
+
78
+
79
+ <jsp-config>
80
+
81
+ <jsp-property-group>
82
+
83
+ <url-pattern>*.jsp</url-pattern>
84
+
85
+ <el-ignored>false</el-ignored>
86
+
87
+ <page-encoding>UTF-8</page-encoding>
88
+
89
+ <scripting-invalid>false</scripting-invalid>
90
+
91
+ <include-prelude>/WEB-INF/view/common/header.jsp</include-prelude>
92
+
93
+ </jsp-property-group>
94
+
95
+ </jsp-config>
96
+
97
+
98
+
99
+ <servlet-mapping>
100
+
101
+ <servlet-name>dispatcherServlet</servlet-name>
102
+
103
+ <url-pattern>/</url-pattern>
104
+
105
+ </servlet-mapping>
106
+
107
+
108
+
109
+ </web-app>
110
+
111
+ ```

1

補足

2018/11/08 01:33

投稿

mk222222
mk222222

スコア59

test CHANGED
File without changes
test CHANGED
@@ -40,44 +40,12 @@
40
40
 
41
41
  同じ書き方ですが、、できるのかやってみます
42
42
 
43
- ```ここに言語を入力
44
-
45
- @Configuration
46
-
47
- public class MessageConfig implements WebMvcConfigurer{
43
+ ※できなかったので消しました。(そもそもWebMvcConfigurerクラスのメソッドにそれらしい奴がなかった)
48
44
 
49
45
 
50
46
 
51
- /*
47
+ spring bootはディフォルトでweb.xmlがないけど、
52
48
 
53
- * DIコンテナにメジプロパティ登録
49
+ jspのヘのincludeしたかった感じです。
54
50
 
55
- */
56
-
57
- @Bean
58
-
59
- public MessageSource messageSource() {
60
-
61
- ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
62
-
63
-
64
-
65
- // メッセージプロパティセット
66
-
67
- messageSource.setBasename("messages");
68
-
69
-
70
-
71
- //@BeanはUTF-8で保持しないので明示的に指定
72
-
73
- messageSource.setDefaultEncoding("UTF-8");
74
-
75
-
76
-
77
- return messageSource;
51
+ できないならひとつひとつincludeします、、
78
-
79
- }
80
-
81
- }
82
-
83
- ```