简体   繁体   English

无法在开发模式下使用GWT

[英]Cannot use GWT in Development Mode

I am attempting to create a client application using the Google Web Toolkit. 我正在尝试使用Google Web Toolkit创建客户端应用程序。 I have downloaded the latest tools and am trying to use Eclipse as my development environment. 我已经下载了最新的工具,并试图使用Eclipse作为开发环境。

I am following the tutorials on the GWT web site. 我正在关注GWT网站上的教程。 It looks like they are mostly out- of- date and incomplete. 看来它们大多是过时且不完整的。

Case in point: I am supposed to be able to run Eclipse in development mode, and the instructions say that to do that you click on Run As "Web Application". 恰当的例子:我应该能够在开发模式下运行Eclipse,并且说明要求您单击“作为Web应用程序运行”。 There is no such command available in the latest GWT SDK for Eclipse! 最新的Eclipse GWT SDK中没有这样的命令!

The commands available when you pick "Run As" (right clicking the project) include "GWT Compiler" and "GWT Development Mode" as well as some other Jetty- related modes. 选择“运行方式”(右键单击项目)时可用的命令包括“ GWT编译器”和“ GWT开发模式”以及其他一些与Jetty相关的模式。 I select "GWT Development Mode" and get a page with the following text: 我选择“ GWT开发模式”,并获得一个包含以下文本的页面:

GWT Code Server
Drag these two bookmarklets to your browser's bookmark bar:
Dev Mode On Dev Mode Off
Visit a web page that uses one of these modules:
testclient
Click "Dev Mode On" to start development mode.

I put the bookmarklets into the bookmark bar and click on my link to testclient. 我将小书签放入书签栏,然后单击指向testclient的链接。 I get a page with the following: 我得到一个页面,其中包含以下内容:

testclient (GWT Code Server)

This module hasn't been compiled yet.

Output Files

(From the last successful compile.)

testclient.nocache.js
testclient.recompile.nocache.js
clear.cache.gif

Note the line that says the module hasn't been compiled. 注意,该行指出模块尚未编译。 When I click on the Dev On bookmark, I get an alert with the following message: 当我单击Dev On书签时,我收到以下消息的警报:

Can't find any GWT Modules on this page.

There is nothing in the tutorial about compiling modules. 本教程中没有关于编译模块的任何内容。 In fact, the tutorial information seems based on using an old dev plugin that doesn't even work in the latest browsers (including Chrome!). 实际上,教程信息似乎基于使用旧的dev插件,而该插件甚至无法在最新的浏览器(包括Chrome!)中运行。 Worse, because the tutorial doesn't describe what I am seeing in dev mode, there is no instruction on how to create the "modules" that the system is looking for. 更糟糕的是,由于本教程没有描述我在开发人员模式下看到的内容,因此没有关于如何创建系统正在寻找的“模块”的说明。

I have tried just using the GWT compiler, and I have tried recreating the project and restarting GWT Development Mode. 我尝试过仅使用GWT编译器,并且尝试过重新创建项目并重新启动GWT开发模式。 I am seeing everything being compiled. 我看到一切都在编译中。 There is nothing anywhere describing whether or not a module is being created, and no instruction on how to make one. 在任何地方都没有描述模块是否正在创建的内容,也没有关于如何创建模块的说明。

This system is looking to be unusable (unfortunate because a few years ago I was able to use GWT to create a single- page application). 该系统看起来无法使用(不幸的是,几年前,我能够使用GWT创建单页应用程序)。 I am hoping someone here knows how to get the dev mode working properly before I abandon GWT completely. 我希望这里的人知道在完全放弃GWT之前如何使开发模式正常工作。

Has anyone created some more complete and up- to- date documentation on how to use GWT??? 是否有人创建了有关如何使用GWT的更完整和最新的文档? Can anyone tell me how to create a module and get the dev mode working properly??? 谁能告诉我如何创建一个模块并使开发模式正常工作?

Someone please advise. 有人请指教。

Dev Mode was deprecated in favor of Super Dev Mode years ago. 开发模式已弃用,几年前改为超级开发模式 Super Dev Mode works with all modern browsers, is closer (if not similar) to production mode and doesn't need any plugins. Super Dev Mode适用于所有现代浏览器,更接近(如果不是相似的话)生产模式,并且不需要任何插件。

However, since classic Dev Mode is the only way to use the IDE to debug client-side Java classes, we still use Firefox v26 with the GWT Developer Plugin for our day-to-day developing and testing. 但是,由于经典开发模式是使用IDE调试客户端Java类的唯一方法,因此我们仍将Firefox v26与GWT开发人员插件一起用于日常开发和测试。 There's not really much of a difference between that and modern browsers. 该浏览器与现代浏览器之间并没有太大区别。
Once the bulk development is done and when you want to test in Chrome / Edge / IE / Safari / mobile / etc. (mostly to refine CSS / UI), you just switch to Super Dev Mode. 批量开发完成后,当您要在Chrome / Edge / IE / Safari /移动设备等环境中进行测试(主要是优化CSS / UI)时,只需切换到超级开发模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM