gpt4 book ai didi

java - 使用 UIBinder 的 GWT 应用程序无法正确加载

转载 作者:行者123 更新时间:2023-11-30 04:54:42 24 4
gpt4 key购买 nike

我使用 UiBinder 的 GWT 应用程序无法在 Internet Explorer 中加载。不过,它在 Firefox、Safari 和 iPhone 上加载得很好。

在尝试隔离问题时,我一直在剥离部分内容,试图找到根本原因。我基本上只剩下一个标签,它仍然可以在 FF 中运行,但不能在 IE 中运行。

这是入口点:

public class Core implements EntryPoint {

private static Core instance;
public static Core instance() {
return instance;
}

@Override
public void onModuleLoad() {
instance = this;
RootPanel container = RootPanel.get("container");
container.add(new Label("hi"));
}
}

这是我的index.jsp:

<!doctype html>
<html>
<head>
<script type="text/javascript" src="core/core.nocache.js"></script>
</head>
<body>
<div id="container"></div>
</body>
</html>

这是我的 appengine-web.xml:

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>realAppNameHere</application>
<version>andrew</version>
<static-files>
<include path="**" />
<!-- The following line requires App Engine 1.3.2 SDK -->
<include path="**.nocache.*" expiration="0s" />
<include path="**.cache.*" expiration="365d" />
<exclude path="**.gwt.rpc" />
</static-files>
<!-- Configure java.util.logging -->
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>
</appengine-web-app>

这是我的 web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

即使有了这个精简版的一切,它仍然可以在 Firefox 中运行,但不能在 IE 中运行。现在甚至没有抛出任何错误,甚至在 Firebug 中也没有......它只是在 IE 中不显示标签,但在 FF 中会显示标签。我不知道为什么它没有运行。

有人有什么想法吗?

编辑3:

忘记了 module.gwt.xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='core'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.google.gwt.ajaxloader.AjaxLoader'/>
<inherits name="com.google.gwt.logging.Logging"/>

<inherits name='com.google.gwt.user.theme.clean.Clean'/>

<entry-point class='com.company.core.client.Core'/>

<source path='client'/>
<source path='shared'/>

<set-property name="gwt.logging.logLevel" value="SEVERE"/>
<set-property name="gwt.logging.enabled" value="FALSE"/>
<set-property name="gwt.logging.consoleHandler" value="ENABLED"/>
<set-property name="gwt.logging.simpleRemoteHandler" value="DISABLED" />
</module>

最佳答案

有些东西在 IE6 中不会出现,但它肯定会被加载。您需要查看的第一件事是您是否已添加 IE6 的用户代理

<set-property name="user.agent" value="ie6"/>

在您的 .gwt.xml 文件中。

接下来您需要检查是否在浏览器安全设置中添加了 localhost 的异常(exception)。

如果所有这些都已完成但仍然不起作用,请尝试清理您的项目并重新编译它。

关于java - 使用 UIBinder 的 GWT 应用程序无法正确加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8917276/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com