2012-10-30 24 views
0

當我任何支柱頁面上訪問我得到這個錯誤,因爲AppEngine上未找到該文件靜:
我一直在谷歌這個,但沒有運氣。的Struts 2.3.4.1的AppEngine 1.7.3 freemarker的com.google.appengine.tools.development.LocalResourceFileServlet

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> 

回答

0

設置上struts.properties

struts.serve.static=true