【问题标题】:Development Console in Google App Engine with Struts 2使用 Struts 2 在 Google App Engine 中开发控制台
【发布时间】:2012-05-02 00:39:26
【问题描述】:

我按照http://www.mkyong.com/google-app-engine/google-app-engine-struts-2-example 的示例在 Google App Engine 中尝试了 Struts 2

它运行良好,但我无法访问应该在 http://localhost:8888/_ah/admin 中访问的开发控制台

是关于过滤器的吗?如何解决?

下面是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>

    <listener>
        <listener-class>com.mkyong.listener.Struts2ListenerOnGAE</listener-class>
    </listener>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
</web-app>

【问题讨论】:

    标签: google-app-engine struts2


    【解决方案1】:

    是的,&lt;url-pattern&gt;/*&lt;/url-pattern&gt; 将所有内容映射到 Struts 过滤器。

    【讨论】:

    • 访问 GAE 开发控制台的解决方法是什么?
    【解决方案2】:

    我通过将下面的代码附加到 struts.xml 来解决它

    <constant name="struts.action.excludePattern" value="/_ah/admin"/>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-18
      • 2023-03-28
      • 2014-09-05
      • 2011-09-13
      相关资源
      最近更新 更多