简体   繁体   English

如何分隔App Engine Eclipse项目和GWT Eclipse项目?

[英]How to seperate App Engine Eclipse project and a GWT Eclipse project?

https://cloud.google.com/eclipse/docs/migrating-gpe#app_engine_gwt says that https://cloud.google.com/eclipse/docs/migrating-gpe#app_engine_gwt

App Engine code runs on the server, and GWT code runs on the client, though it's compiled and served from the server. App Engine代码在服务器上运行,而GWT代码在客户端上运行,尽管它们是由服务器编译和提供的。 Ideally you should divide these into separate projects: an App Engine Eclipse project and a GWT Eclipse project. 理想情况下,您应该将它们分为不同的项目:一个App Engine Eclipse项目和一个GWT Eclipse项目。

Is there any doc about how to do this seperation? 是否有任何有关如何进行分离的文档?

How to handle GWT-RPC? 如何处理GWT-RPC? For example, XService.java and XServiceAsync.java is at clientside but XServiceImpl.java is at serverside, will it be in App Engine project?) 例如,XService.java和XServiceAsync.java在客户端,而XServiceImpl.java在服务器端,它将在App Engine项目中吗?)

The answer is to use an intermediate "shared" project. 答案是使用中间的“共享”项目。 This project holds the classes which are written in plain Java and will run correctly on the server and on any client. 该项目包含用纯Java编写的类,它们将在服务器和任何客户端上正确运行。

Then, two other projects are created, as you described above: a server project and a client project. 然后,如上所述创建另外两个项目:服务器项目和客户端项目。 Each of these will then depend on the shared project as a library, and then GWT can be enabled on the client project, and App Engine on the server project. 然后,它们中的每一个都将依赖共享项目作为库,然后可以在客户端项目上启用GWT,并在服务器项目上启用App Engine。

Some care must be taken when building the server project to include the output of the client project - the compile JS must be present in the generated App Engine output war, in the same location as you had it previously. 在构建服务器项目以包括客户端项目的输出时,必须格外小心-编译JS必须出现在生成的App Engine输出war中,与您之前的位置相同。 This is going to be specific to how you set up your project before. 这将特定于您之前设置项目的方式。

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

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