0

アプリケーションを Web にデプロイしました。Apache Tomcat のバージョンは 6.0.36 です

URL: www.sopmax.com

index.html (ようこそページ) は、リクエストを sopmax.com/welcome に転送します。

エラーが発生しました: コンテキスト パス [] に関連付けられた名前空間 [/] およびアクション名 [ようこそ] にマッピングされたアクションはありません

以下は私の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" id="WebApp_ID" version="2.5">
  <display-name>ShoppingShoe</display-name>

  <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>


<listener>
    <listener-class>
        org.apache.struts2.tiles.StrutsTilesListener
    </listener-class>
</listener>
<context-param>
    <param-name>tilesDefinitions</param-name>
    <param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
<welcome-file-list>
    <welcome-file>
        index.html
    </welcome-file>
  </welcome-file-list>
</web-app>

struts.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
   "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
   "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
    <constant name="struts.devMode" value="true" />
    <constant name="struts.custom.i18n.resources" value="global" />
    <package name="default" extends="struts-default" namespace="/">
    <result-types>
        <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
    </result-types>  
    <interceptors>
        <interceptor name="secure" class="com.mss.interceptor.SecureStack">
        </interceptor>
        <interceptor-stack name="securestack">
            <interceptor-ref name="secure"></interceptor-ref>
            <interceptor-ref name="defaultStack"></interceptor-ref>
        </interceptor-stack>
    </interceptors>      
    <default-interceptor-ref name="securestack"></default-interceptor-ref>
        <action name="welcome*" class="com.mss.actions.Welcome" method="showHome">
            <result type="tiles" name="success">welcome</result>
        </action> 
 </package>    

</struts>

com.mss.actions.Welcome クラスに showHome メソッドがあり、それは完全に機能します。同じアプリケーションがローカル サーバーでは問題なく実行されていますが、Web 上では実行されていません。

struts.devmode=true も設定しましたが、エラーは struts ではなく tomcat によって生成されたようです。私が欠けているものを教えてください。

サーバー: tomcat-apache 6.0.36 Java: 私は 1.7 で開発しましたが、おそらく Web では 1.6 を使用しています。

4

1 に答える 1