Can';t在Netbeans 7上运行gwt hello world
你好!我从GWT2.5开始。我已经在netbeans_7上安装了org-netbeans-modules-gwt4nb-2.10.5.nbm。在我使用GlassFish 3+在NetBeans_7中构建并运行easy gwt app()之后,默认浏览器(firefox_14)启动了一个相应的页面并输出空页面。有什么问题吗?我还在firefox_14上安装了gwt dev插件,但得到了相同的结果。Can';t在Netbeans 7上运行gwt hello world,gwt,netbeans-7,Gwt,Netbeans 7,你好!我从GWT2.5开始。我已经在netbeans_7上安装了org-netbeans-modules-gwt4nb-2.10.5.nbm。在我使用GlassFish 3+在NetBeans_7中构建并运行easy gwt app()之后,默认浏览器(firefox_14)启动了一个相应的页面并输出空页面。有什么问题吗?我还在firefox_14上安装了gwt dev插件,但得到了相同的结果。 主要入口点 ... public class MainEntryPoint implements E
主要入口点
...
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>
主要
您的web浏览器必须启用JavaScript
以使此应用程序正确显示。
我收到以下警告:
当我运行应用程序时,我从服务器收到以下消息:GWT4NB插件似乎使用了旧的GWT编译器类,这就是为什么您会收到警告。然而,这不应该是一个问题。404错误表明缺少某些内容,或者您将浏览器指向错误的URL。主机页的名称必须与URL中的页面名称匹配。由于主机页名为HelloGWT.html,请确保打开的URL如下所示:
http://127.0.0.1:8080/HelloGWT.html
对于最终构建,我建议您使用Ant或Maven。查看官方GWT文档,打开GWT.properties文件,根据需要更改GWT.output.dir条目(/后跟条目GWT.module的值)。
Meziano你的应用程序在做什么?你能给我们看看入口点课程吗?确保在根面板中添加一些内容。是。我调用不带参数的RootPanel(因此,这一个封装了元素),并向面板添加了一个标签和一个按钮:EntryPoint类和您的主机页在我看来确实不错。您是否检查了编译期间或启动开发模式时是否存在任何错误?如果一切正常,开发模式应该给你一个“模块加载”消息。我已经编辑了我的消息,并指出了我从编译器收到的所有警告。