struts 2 を使用してこの例を実行しようとしています。Eclipse の動的 Web プロジェクトの Web-Inf の Lib フォルダーにライブラリーを挿入しました。
私の Web.xml は次のようになります。
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
struts.xml を作成し、ソース フォルダー内に配置しました。その内容は次のとおりです。
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<!-- Configuration for the default package. -->
<package name="default" extends="struts-default">
<action name="UserAction" class="struts.UserAction">
<result name="input">/index.jsp</result>
<result name="success">/result.jsp</result>
</action>
</package>
</struts>
だから今、任意のjspを実行すると、Eclipseコンソールで次のエラーが発生します
構成を読み込めません。- bean - jar:file:/D:/Users/Don/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/Mscs674-Struts2/WEB-INF/lib/struts2-gxp -plugin-2.3.4.jar!/struts-plugin.xml:8:162
そしてこれはウェブページで
HTTP Status 404 -
type Status report
message
description The requested resource () is not available.
助言がありますか ?