再会!我从 gwt 2.5 开始。我已经在 NetBeans_7 上安装了 org-netbeans-modules-gwt4nb-2.10.5.nbm。在我使用 GlassFish 3+ 在 NetBeans_7 中构建并运行了一个简单的 gwt 应用程序(在此处输入链接描述)后,默认浏览器(firefox_14)启动了一个相应的页面并输出空页面。有什么问题?我还在 firefox_14 上安装了 gwt dev 插件,但我得到了相同的结果。
主要入口点
...
public class MainEntryPoint implements EntryPoint {
/**
* Creates a new instance of MainEntryPoint
*/
public MainEntryPoint() {
}
/**
* The entry point method, called automatically by loading a module that
* declares an implementing class as an entry-point
*/
@Override
public void onModuleLoad() {
final Label label = new Label("Hello, GWT!!!");
final Button button = new Button("Click me!");
button.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
label.setVisible(!label.isVisible());
}
});
RootPanel.get().add(button);
RootPanel.get().add(label);
}
}
...
HelloGWT.html
<!doctype html>
<!--
The DOCTYPE declaration above will set the browser's rendering engine into
"Standards Mode". Replacing this declaration with a "Quirks Mode" doctype may
lead to some differences in layout.
-->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name='gwt:module' content='gwt.intro.Main=gwt.intro.Main'>
<title>Main</title>
</head>
<body>
<script type="text/javascript" src="gwt.intro.Main/gwt.intro.Main.nocache.js"></script>
<!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
<noscript>
<div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
Your web browser must have JavaScript enabled
in order for this application to display correctly.
</div>
</noscript>
</body>
</html>
我收到以下警告:
- GWT 编译客户端代码。 警告:“com.google.gwt.dev.GWTCompiler”已弃用,将在未来版本中删除。请改用“com.google.gwt.dev.Compiler”。(要禁用此警告,请将 -Dgwt.nowarn.legacy.tools 作为 JVM 参数传递。);
- 计算“com.google.gwt.useragent.client.UserAgentAsserter”的所有可能的重新绑定结果重新绑定 com.google.gwt.useragent.client.UserAgentAsserter 检查规则 [WARN]检测到与“com.google.gwt.editor.client”相关的警告.SimpleBeanEditorDriver'。类路径上是否有validation-api-.jar 和validation-api--sources.jar?指定 -logLevel DEBUG 以查看所有错误。 [警告]延迟绑定规则中指定的未知类型“com.google.gwt.editor.client.SimpleBeanEditorDriver”
一旦我运行该应用程序,我就会从服务器收到以下消息:http: //postimage.org/image/uf6lcczjb/