GWT 和 PhoneGap 如何协同工作?
我一直在使用 GWT 项目,GWT 的场景是编译然后部署到 Web 服务器(如 Tomcat),但是我想尝试 PhoneGap,这样我就可以使用单个代码开发 Android / Iphone 应用程序基础,也许使用熟悉的 Web 风格的 UI。
如果我将 GWT 与 PhoneGap 结合使用,应用程序是否仍需要后端 Web 服务器来显示 UI?
I have been working with GWT projects, and the scenario with GWT is that it is compiled then deployed to a web server (like Tomcat), however I want to try out PhoneGap, so I can develop a Android / Iphone app using a single code base and perhaps using the familiar web-style UI.
If I use GWT with PhoneGap, would the application still need a back-end web server to display the UI?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的具体问题的答案是否定的,您不一定需要后端 Web 服务器来显示 UI。但这并不意味着您的应用程序可以在phonegap中无缝工作。如果您将 GWT 应用程序限制为仅客户端代码并调用 GWT 应用程序之外的服务,您应该生成一个 Web 应用程序,您可以获取战争的所有内容(减去 WEB-INF 目录)并将其放入phonegap(或您选择的 Web 服务器)并在没有 Java 应用程序服务器的情况下运行应用程序。我通过这种方式在 Apache HTTPD 服务器上运行我的应用程序,取得了非常好的成功。不过,我在 PhoneGap 中运行它并取得了有限的成功。应用程序的某些部分运行良好,而其他部分则不然。因此,您必须进行大量测试来找出哪些有效、哪些无效,然后相应地限制您的工作,但原则上可以使用 GWT 来开发在 PhoneGap 中使用的 UI。
The answer to your specific question is no, you do not necessarily need the back end web server to display the UI. That does not mean that your application will seamlessly work in phonegap though. If you limit your GWT app to just client side code and call services outside of the GWT app you should be producing a web app that you can grab all of the content of the war minus the WEB-INF directory and drop it into phonegap (or the web server of your choice) and run the app without a java application server. I have had very good success with running my applications on Apache HTTPD Server this way. I have had limited success running it in PhoneGap though. Some parts of the applications function fine, others do not. So you will have to do quite a bit of testing to find out what works and what doesn't and then restrict your work accordingly but in principle it is possible to use GWT for developing a UI to use in PhoneGap.