A sample build of this project can be found at: https://fair-myth-128602.appspot.com/
- JDK 8 with JAVA_HOME set
- Chrome browser (optional)
We can use any IDE that can import a Gradle project. Both Intellij and Eclipse are good options.
Run the following commands in daemon mode or as separate processes:
>>>gradlew appengineRun
>>>gradlew gwtSuperDev
These commands boots up two local servers:
- SuperDevMode at
http://localhost:9876
which listens to requests to recompile your code - AppEngine at
http://localhost:8080
which serves the app itself
Go to SuperDevMode server in your browser and follow the instructions to save the bookmarks that allow you to recompile your app.
Now you can go to the AppEngine server to view your app.
If you don't see anything, click on the Dev Mode On
bookmark you saved earlier and then hit Compile
on the opened modal.
This will sent a request to SuperDevMode server to initiate a recompile and reload your page.
You can avoid the modal by bookmarking the Compile
button for one-click compile + reload.
Note: it is also recommended to use Chrome browser to debug your applications as it fully supports source maps used by GWT.
Stop your local App Engine server then:
>>>gradlew appengineUpdate
This uploads the app to App Engine. It will override the version (defined in appengine-web.xml
) on App Engine if it exists or else it will create that version.
If the uploaded app has a new version, run:
>>>gradlew appengineSetDefaultVersion
to tell App Engine to start serving the new version on production.
src/main/java/webapp/
contains web application sources as specificed by thewar
plugin for Gradle.src/main/java/com/jingyu/example/
contains all the GWT and App Engine application logic.
src/main/java/com/jingyu/example/Example.gwt.xml
this is the main GWT configuration file.src/main/webapp/WEB-INF/web.xml
this is the main url routing file.src/main/webapp/WEB-INF/appengine-web.xml
configuration file for App Engine.
- Generated by Gradle:
.gradle/
: Gradle settingsbuild/
: Compiled Javascripts and resourceswar/
: Mirrorssrc/main/java/webapp/
- Generated by Eclipse:
bin/
: Temporary build files.project
: Main Eclipse project file.classpath
: Classpath information for Eclipse.settings/
: Misc settings
- Generated by Intellij Idea:
.idea
: IDE settings
-
the import com.google.appengine cannot be resolved
- Problem: You are trying to use App Engine in the client code.
- Solution: Don't do it.
-
Rebind result 'com.something.something.SomeServiceAsync' must be a class
- Problem: You are trying to create an async service from an async class.
- Solution: You have to create the async service from the synchronous version of the service. The GWT compiler does some runtime magic to mash the interfaces.
-
Getting
404
s for RPCs?- Did you map the servlets to url in
web.xml
? - Did you restart the App Engine server after you made changes server side?
- Did you map the servlets to url in
- https://gradle.org/getting-started-gradle-java/
- http://www.gwtproject.org/
- https://cloud.google.com/appengine/docs/java/
- https://github.com/GoogleCloudPlatform/gradle-appengine-plugin
- https://github.com/steffenschaefer/gwt-gradle-plugin
- http://www.blueesoteric.com/blog/2015/05/eggg-eclipse-gwt-gae-and-gradle
- https://examples.javacodegeeks.com/core-java/gradle/gradle-gwt-integration-example/
- Port over more example code and comments from the example project generated by Google Plugin for Eclipse
- Basic UiBinder stuff
- Material Design
- MVC with GWTP?
- Tests