0

appengine がこの静的ファイルを見つけられないため、Struts ページにアクセスするとこのエラーが発生します

    oct 30, 2012 12:24:32 PM com.google.appengine.tools.development.LocalResourceFileServlet doGet
WARNING: No file found for: /struts/xhtml/styles.css
oct 30, 2012 12:24:32 PM com.google.appengine.tools.development.LocalResourceFileServlet doGet
WARNING: No file found for: /struts/utils.js
oct 30, 2012 12:24:32 PM com.google.appengine.tools.development.LocalResourceFileServlet doGet
WARNING: No file found for: /struts/xhtml/validation.js
oct 30, 2012 12:24:33 PM com.google.appengine.tools.development.LocalResourceFileServlet doGet
WARNING: No file found for: /struts/utils.js

web.xml にストラット用のフィルターがあります (そのように見えます):

<filter>
        <filter-name>struts2</filter-name>
        <filter-class>
        org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
        </filter-class>
    </filter>

    <!-- 
I've tried this option too!!!!
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>*.action</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/struts/*</url-pattern>
    </filter-mapping>
    -->

    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

私の appengine-web.xml には静的ファイル ディレクトリがあります。

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>myapp</application>
    <version>1</version>

    <threadsafe>false</threadsafe>

    <sessions-enabled>true</sessions-enabled>

    <!-- Configure java.util.logging -->
    <system-properties>
        <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
    </system-properties>

    <!-- Static files -->
    <static-files>
        <include path="/css/*" />
        <include path="/struts/*" />
        <include path="/struts/xhtml/*" />
        <include path="/js/*" />
    </static-files>
</appengine-web-app>
4

1 に答える 1

0

struts.properties に設定

struts.serve.static=true
于 2012-10-30T12:05:05.653 に答える