Search code examples
javagoogle-app-enginegwtgoogle-cloud-tools

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

App Engine code runs on the server, and GWT code runs on the client, though it's compiled and served from the server. Ideally you should divide these into separate projects: an App Engine Eclipse project and a GWT Eclipse project.

Is there any doc about how to do this seperation?

How to handle 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?)


Solution

  • 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.

    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.

    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. This is going to be specific to how you set up your project before.