【问题标题】:Blank page with Google Web Toolkit带有 Google Web Toolkit 的空白页面
【发布时间】:2010-12-22 09:25:37
【问题描述】:

我是 Google Web Toolkit 的新手。我尝试使用 NetBeans 创建新项目,并从 Frameworks-list 中获取 Google Web Toolkit。如果我将“org.yournamehere.Main”保留为 GWT 模块名称,它会起作用。但是如果我在那里写一些自己的东西,我能看到的只是一个空白的 html 页面,其来源如下:

<head>

    <meta name='gwt:module' content='vvv.test.module=vvv.test.module'>

    <title>moduuli</title>

</head>

<body>

    <script type="text/javascript"  src="vvv.test.module/vvv.test.module.nocache.js"></script>

</body>

【问题讨论】:

    标签: java gwt netbeans


    【解决方案1】:

    尝试; (将 {PROJECT_NAME} 替换为您的项目名称)

    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <!-- <meta name="gwt:property" content="locale=tr"> -->
    
        <!--                                                               -->
        <!-- Consider inlining CSS to reduce the number of requested files -->
        <!--                                                               -->
        <link type="text/css" rel="stylesheet" href="{PROJECT_NAME}.css">
    
        <!--                                           -->
        <!-- Any title is fine                         -->
        <!--                                           -->
        <title>{TITLE}</title>
    
        <!--                                           -->
        <!-- This script loads your compiled module.   -->
        <!-- If you add any GWT meta tags, they must   -->
        <!-- be added before this line.                -->
        <!--                                           -->
        <script type="text/javascript" language="javascript" src="{PROJECT_NAME}/{PROJECT_NAME}.nocache.js"></script>
      </head>
    
      <!--                                           -->
      <!-- The body can have arbitrary html, or      -->
      <!-- you can leave the body empty if you want  -->
      <!-- to create a completely dynamic UI.        -->
      <!--                                           -->
      <body>
    ....
    

    【讨论】:

      【解决方案2】:

      我明白了。 NetBeans 将 {PROJECT_NAME}.nocache.js 文件放入错误的文件夹(My Documents\NetBeansProjects\ProjectName\build\web\org.yournamehere.Main。在 gwt.properties 中有一行 gwt.output.dir=/org.yournamehere.Main .file。我修复了这个问题并进行了“清理和构建”。

      好在现在我对 GWT 有了更多的了解。还是谢谢。

      【讨论】:

        【解决方案3】:

        当我使用 NetBeans 启动我的第一个 GWT RPC Hello-World 应用程序时,我遇到了同样的问题。

        获取空白页,您可能需要检查以下内容:

        • WelcomeGWT.html(或 index.html)在网页文件夹下

        确保脚本源链接正确:

        src="org.yournamehere.ModuleName/org.yournamehere.ModuleName.nocache.js"

        如果您使用重命名属性检查 why does changing "module -> rename to" attribute in .gwt.xml file give error


        • Web.xml Web-INF 文件夹下的文件

        确保 url 模式正确:

        <servlet-name>ServerSideServiceImpl</servlet-name>
        <url-pattern>/org.yournamehere.ModuleName/RemoteServiceRelativePath</url-pattern>
        

        要更好地了解 RemoteServiceRelativePath,请查看Error 404 on GWT RPC


        • 检查您的 EntryPoint.java

        有时可能是小错误,例如,

        忘记将面板添加到 RootPanel。

        WelcomeGWT.html 中的 ID 拼写错误

        RootPanel.get("gwtContainer").add(panel);

        【讨论】:

          猜你喜欢
          • 2014-06-26
          • 1970-01-01
          • 2020-05-23
          • 1970-01-01
          • 1970-01-01
          • 2022-01-23
          • 1970-01-01
          • 2022-06-21
          • 2023-02-06
          相关资源
          最近更新 更多