Google Web Toolkit Introduction to GWT Development Ilkka Rinne & Sampo Savolainen / Spatineo Oy GeoMashup CodeCamp 2011 University of Helsinki Department of Computer Science
Google Web Toolkit
Google Web Toolkit Code your browser apps in Java
Google Web Toolkit Code your browser apps in Java Test your app locally in your browser
Google Web Toolkit Code your browser apps in Java Test your app locally in your browser Debug your code using regular IDE debuggers
Google Web Toolkit Code your browser apps in Java Test your app locally in your browser Debug your code using regular IDE debuggers
Google Web Toolkit Code your browser apps in Java Test your app locally in your browser Debug your code using regular IDE debuggers GWT compiles your app into optimized JavaScript
Google Web Toolkit Code your browser apps in Java Test your app locally in your browser Debug your code using regular IDE debuggers GWT compiles your app into optimized JavaScript
Google Web Toolkit Code your browser apps in Java Test your app locally in your browser Debug your code using regular IDE debuggers GWT compiles your app into optimized JavaScript Deploy anywhere (it s just JS + CSS + HTML)
Don t Worry About
Don t Worry About Coding in JavaScript (embed JavaScript code with JSNI if you really have to)
Don t Worry About Coding in JavaScript (embed JavaScript code with JSNI if you really have to) Developing in browser (use the Java IDE you like)
Don t Worry About Coding in JavaScript (embed JavaScript code with JSNI if you really have to) Developing in browser (use the Java IDE you like) Implementation details of client-server communication over HTTP
Don t Worry About Coding in JavaScript (embed JavaScript code with JSNI if you really have to) Developing in browser (use the Java IDE you like) Implementation details of client-server communication over HTTP Writing cross-browser compatible JavaScript + DOM
Development Mode Since GWT 2.0: dev mode code is run in the browser as Java (GWT Dev Plugin) IDE Java debugging, code hot swapping as you save & refresh. Speeds things up! Dev mode also runs a local server to simulate your server side GWT code (RPC Servlets)
UI Components Basic components for building Java-like GUIs for browser applications: Page & panel layouts Buttons, trees, tables, input fields, etc.
UI Components Basic components for building Java-like GUIs for browser applications: Page & panel layouts Buttons, trees, tables, input fields, etc.
UI Components Basic components for building Java-like GUIs for browser applications: Page & panel layouts Buttons, trees, tables, input fields, etc.
UI Components Basic components for building Java-like GUIs for browser applications: Page & panel layouts Buttons, trees, tables, input fields, etc.
UI Components Basic components for building Java-like GUIs for browser applications: Page & panel layouts Buttons, trees, tables, input fields, etc.
UI Components Basic components for building Java-like GUIs for browser applications: Page & panel layouts Buttons, trees, tables, input fields, etc. Extended by third party developers to provide more elaborate components Demo: http://gwt.google.com/samples/showcase/showcase.html
Google API Integration Google API integration using separate libraries Gears API Library 1.3 Gadgets API Library 1.2 Google AJAX Search API Library 1.1 Currently released: Google Maps API Library 1.1 Note: use 1.1.1-RC1 for now! Google Chart Tools (aka Visualization) Library 1.1 Google Language API Library 1.1 Google Ajax Loader API Library 1.1 Google+ API Library 0.2-alpha Google Books API Library 0.2-alpha Google Latitude API Library 0.2-alpha etc. http://code.google.com/p/gwt-google-apis/
JRE Emulation Library Final GWT apps run in JavaScript (without JRE) GWT Provides JRE emulation for JRE 1.5 basic functionality, but not all of it. Be especially careful with time/date handling, regular expressions, number formatting, timers http://code.google.com/webtoolkit/doc/latest/devguidecodingbasicscompatibility.html
Java-to-JavaScript Compiler When you re ready to deploy your code, ask GWT to compile GWT generates JS, HTML, CSS, packages them into a WAR file with image resources etc. Ready to be deployed on a Java Servlet Container or Google App Engine Note: Extract <appname>.nocache.js and <md5>.cache.html + resources from the WAR file to run without a Servlet Container
Let s see some code! GWT Development in Eclipse Codecamp demo application Deployment to Google App Engine