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

質問編集履歴

1

設定ファイル追加

2020/09/20 09:32

投稿

post123456
post123456

スコア73

title CHANGED
File without changes
body CHANGED
@@ -1,4 +1,39 @@
1
1
  struts2-convention-pluginをWEB-INF>libいれ、tomcatを起動させ画面表示すると、 The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.と404エラーが表示されます。struts2-convention-pluginを消すと問題なく再度表示されます。
2
2
 
3
3
 
4
- struts2-convention-pluginをWEB-INF>libいれた状態で、画面表示されるようにしたいのですが、何が問題となっているかお分かりのかたおられますでしょうか?
4
+ struts2-convention-pluginをWEB-INF>libいれた状態で、画面表示されるようにしたいのですが、何が問題となっているかお分かりのかたおられますでしょうか?
5
+
6
+ web.xml
7
+ <filter>
8
+ <filter-name>struts2</filter-name>
9
+ <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
10
+ </filter>
11
+
12
+ <filter-mapping>
13
+ <filter-name>struts2</filter-name>
14
+ <url-pattern>/*</url-pattern>
15
+ </filter-mapping>
16
+ </web-app>
17
+
18
+
19
+ struts.xml
20
+
21
+ <?xml version="1.0" encoding="UTF-8"?>
22
+ <!DOCTYPE struts PUBLIC
23
+ "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
24
+ "http://struts.apache.org/dtds/struts-2.0.dtd">
25
+ <struts>
26
+ <!-- アクションのパッケージ定義 -->
27
+ <package name="default" extends="struts-default">
28
+ <!-- Hello worldのサンプルアクション -->
29
+
30
+ <action name="top" class="sample.IndexAction" method="execute">
31
+ <result name="success">/view/sample/index.jsp</result>
32
+ </action>
33
+ <action name="hello" class="sample.TestAction"
34
+ method="execute">
35
+ <result name="success">/view/sample/index.jsp</result>
36
+ </action>
37
+ </package>
38
+
39
+ </struts>