Giter VIP home page Giter VIP logo

gwt-messenger-example's Introduction

Example Gradle + GWT + Google App Engine project

A sample build of this project can be found at: https://fair-myth-128602.appspot.com/

Dependencies

  • JDK 8 with JAVA_HOME set
  • Chrome browser (optional)

How to...

IDEs

We can use any IDE that can import a Gradle project. Both Intellij and Eclipse are good options.

Development mode

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.

Deploy

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.

Project structure

Layout

  • src/main/java/webapp/ contains web application sources as specificed by the war plugin for Gradle.
  • src/main/java/com/jingyu/example/ contains all the GWT and App Engine application logic.

Important files

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

Ignored files and folders

  • Generated by Gradle:
    • .gradle/: Gradle settings
    • build/: Compiled Javascripts and resources
    • war/: Mirrors src/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

Some common errors

  • 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 404s 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?

Resources

Official links

Other helpful guides (may not be compatible with this one)

Todo...

  • 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

gwt-messenger-example's People

Contributors

jingyuyao avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.