【问题标题】:Including GWT in Tapestry 4在 Tapestry 4 中包含 GWT
【发布时间】:2015-03-04 14:31:47
【问题描述】:

我在 JBoss 4.3 服务器上运行 Tapestry 4。 Web 应用程序在 http://localhost:8080/TapestryGISPlayerground/ 运行 在这个 Tapestry 中,我使用 GWT 代码。这是主页:

<html jwcid="@Shell" title="literal:'TapestryGISPlayerground' Start Page" >
<body jwcid="@Body">
<h1>view Start Page</h1>

<script language="javascript" src="/TapestryGISPlayerground/tapestryGWT/tapestryGWT.nocache.js"></script>

<p>This is the start page for this application, a good place to
start your modifications. Just to prove this is live:</p>

<p><span jwcid="time@Any"> The current time is: <span
  jwcid="@Insert" value="ognl:currentTime"> 12/22/2002 blah </span> </span></p>
<div id="Derpington">
</div>

</body>
</html>

这应该基本上可以工作,但这就是它变得棘手的地方。 nocache.js 对 http://localhost:8080/TapestryGISPlayerground/tapestryGWT/107089FA8293C4684B109E80DDA15F8F.cache.html 执行 get 请求以获取其真实代码 (http://www.gwtproject.org/doc/latest/DevGuideOrganizingProjects.html#DevGuideBootstrap)。但是 Tapestry 看到我试图获取 HTML 页面并将请求重定向到上面的主页。这又会重新下载 nocache.js 并开始无限循环。

而不是执行:

public class TapestryEntry implements EntryPoint {

  public void onModuleLoad() {
    GWT.log("BLABLA");
    Window.alert("Im doing SOMETHING!");
    RootPanel.get("Derpington").add(new InlineLabel("Derp"));
  }

}

它在不执行我的入口点的情况下重新下载页面几千次。

我该怎么做:

  • 让 Tapestry 无法捕获 GWT 发出的请求或
  • 使 GWT 不使用 .html,而是使用不同的文件类型进行下载

有人知道怎么做吗?

补充说明:

  • GWT 版本:2.6.0
  • Tapestry 版本:4.1.6(不是我的选择,需要在现有的 Tapestry 页面中构建一些东西)

【问题讨论】:

    标签: gwt tapestry


    【解决方案1】:

    通过更改修复它:

     <servlet-mapping>
        <servlet-name>app</servlet-name>
        <url-pattern>*.html</url-pattern>
      </servlet-mapping>
    

    收件人:

     <servlet-mapping>
        <servlet-name>app</servlet-name>
        <url-pattern>/index.html</url-pattern>
      </servlet-mapping>
    

    在 web.xml 中

    【讨论】:

      【解决方案2】:

      升级到新版本!

      Tapestry 5 集成了: http://wiki.apache.org/tapestry/Tapestry5GWTIntegration

      【讨论】:

      • 是的,但是范围不允许:(
      猜你喜欢
      • 2011-11-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-30
      • 1970-01-01
      • 1970-01-01
      • 2013-07-02
      • 1970-01-01
      相关资源
      最近更新 更多