SlideShare a Scribd company logo
The Google Web Toolkit (GWT)
Overview & Getting Started
buithaibinh@gmail.com
2014/5
1
Topics in This Section
๏ What GWT is all about
• Why(Love Story :D)
• Advantages
• Disadvantages
๏ Installing GWT
• Core GWT
• Eclipse plugin
• Browser plugin
๏ Making a project
• Using Eclipse plugin
๏ Testing process
2
Why(Love Story :D)
3
Why Web Apps(MVC)?
• Downsides to browser-based apps
• GUI is poor
• HTML is OK for static documents, but lousy for programs
• Communication is inefficient
• HTTP is poor protocol for the way we now use Web apps
4
Why Web Apps(MVC)? (Continued)
• So why does everyone want Web apps?
• Universal access
• Everyone already has a browser installed
• Any computer on the network can access content
• Automatic “updates” (MVC)
• Content comes from server, so is never out of date
5
Why Ajax?
• Solve three key problems of Web apps
• Coarse-grained updates
• Synchronous: you are frozen while waiting for result
• Extremely limited options for widgets (GUI elements)
• Still browser based
• Ajax is about “what is the best you can do with what everyone already has in their browser?”
• “Real” browser-based active content
• Failed: Java Applets
• Not universally supported; can’t interact with the HTML
• Serious alternative: Flash/Flex
• Not preinstalled on all PCs; not available for iPhone/iPad
• Less proven
• Microsoft Silverlight
• JavaFX
6
Ajax Problems
• At least two languages are required
• JavaScript on the client
• Java or another language on the server
• Invoking server is cumbersome
• Even with JSON-RPC, DWR, or jQuery support
• Want more powerful RPC mechanism
• JavaScript scales poorly to large projects
• No strong typing
• Weak object hierarchies
• Many run-time errors instead of compile-time errors
• Incompatibility across platforms
• Can’t use preexisting Java libraries or utilities
7
Overview of the
Google Web Toolkit (GWT)
• Big Idea
• You write both client-side and server-side code in Java
• Client-side code
• Uses an API similar to Swing
• Most basic JDK 1.6 constructs and classes supported
• Gets compiled into JavaScript that runs in your browser
• Server-side code
• Client uses a callback API and specifies data source URL
• Once you define callback, you are mostly using regular Java method calls with complex arguments and return values
• Server extends special class and defines regular methods
• These are not servlet-style doBlah methods linked to HTTP
• Arguments and return values can b
• » Primitives, strings, arrays, a few java.util collections, Serializable custom classes
8
Sites that Use GWT
• Google Sites
• Apache Wave, Google Base,
• Google Checkout,
• Google Moderator
• Google Web
• Google AdSense
• Outside Sites
• phuongbook.com :D
9
Advantages of GWT
• No JavaScript syntax errors
• Use a reliable, strongly-typed language (Java) for development and debugging
• No JavaScript programming at all!
• Can use complex Java on the client
• Turned into JavaScript, but you still use String, array, Math class, ArrayList, HashMap,
custom classes, etc.
• Full IDE-based Java support for development and debugging
• Your client-side code can share data structures with your server-side code
10
Advantages of GWT (Continued)
• Can send complex Java types to/from the server
• Real Java objects gets serialized across network.
• More powerful and convenient approach than JSON-RPC
• Standalone test environment
• Can test within Eclipse without installing a new server
• Support by a major company
• Supported by the company that popularized Ajax in the first place
• Support won’t go away like perhaps with AjaxTags
11
Advantages of GWT (Continued)
• Faster Apps
• GWT uses deferred binding
• Sends exactly the right code for the user’s circumstances
• User agent
• Locale
• Debug vs. production
• Network characteristics
• Java is not compiled “blindly” into JavaScript
• Many advanced compiler design techniques are used to make everything faster
12
Disadvantages of GWT
• Nonstandard approach to HTML & JavaScript
• Programmatic creation of HTML can make use of standard HTML and
CSS tools more difficult.
• You never explicitly put JavaScript in your HTML.
• Very powerful in the long run; hard to get used to at first.
• Not search engine friendly
• Google and others won’t index the dynamic content
13
Disadvantages of GWT
(Continued)
• Only for Java developers
• Most Ajax environments do JavaScript on the client and have a choice for the server. GWT is
based entirely around Java.
• GWT does support “normal” Ajax requests, but if you didn’t plan to mostly use Java on server,
would you choose GWT in the first place?
• Can’t(hard) make use of the good features of JavaScript
• Fast prototyping, functional programming, easy DOM querying and manipulation (e.g., with
jQuery)
• Unusual approach
• Fundamentally different strategy than all other Ajax tools makes evaluation and management buyoff
harder
14
Installation and Setup
15
Installation: Overview
• Install Eclipse Plugin
• https://developers.google.com/eclipse/docs/getting_started
• Choose to install the GWT SDK at the same time
• Install Browser Plugin
• The first time you run in a browser in development mode, it will prompt you to install browser plugin.
• See details in section on running in Production Mode
• (Optional) Install GWT SDK
• https://developers.google.com/web-toolkit/download
• Download ZIP file and unzip into folder of your choice
• Optional because you can get it bundled with Eclipse plugin
• (Optional) Install Speed Tracer
• Performance profiler. See top-level download page from first bullet. Not discussed here.
16
Making a project - Demo
17
Testing Projects
18
Testing the Project in Development Mode
19
Testing Project in Production Mode
20
Deploying the Project to Normal Java App Server
21
Questions?
22
Ad

More Related Content

What's hot (20)

ITT Flisol 2013
ITT Flisol 2013ITT Flisol 2013
ITT Flisol 2013
Domingo Suarez Torres
 
Modern javascript
Modern javascriptModern javascript
Modern javascript
Kevin Ball
 
Web application I have always dreamt of
Web application I have always dreamt ofWeb application I have always dreamt of
Web application I have always dreamt of
Victor_Cr
 
Kickstart Jpa
Kickstart JpaKickstart Jpa
Kickstart Jpa
Max Andersen
 
Saving Time By Testing With Jest
Saving Time By Testing With JestSaving Time By Testing With Jest
Saving Time By Testing With Jest
Ben McCormick
 
Integration Testing with Selenium
Integration Testing with SeleniumIntegration Testing with Selenium
Integration Testing with Selenium
All Things Open
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscape
Radosław Scheibinger
 
Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"
Provectus
 
Agile sites311training
Agile sites311trainingAgile sites311training
Agile sites311training
Michele Sciabarrà
 
Jasmine - A BDD test framework for JavaScript
Jasmine - A BDD test framework for JavaScriptJasmine - A BDD test framework for JavaScript
Jasmine - A BDD test framework for JavaScript
Sumanth krishna
 
CQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and DeploymentCQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and Deployment
klcodanr
 
Micronaut Deep Dive - Devnexus 2019
Micronaut Deep Dive - Devnexus 2019Micronaut Deep Dive - Devnexus 2019
Micronaut Deep Dive - Devnexus 2019
graemerocher
 
Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications
Paul Withers
 
End to-end W3C - JS.everywhere(2012) Europe
End to-end W3C - JS.everywhere(2012) EuropeEnd to-end W3C - JS.everywhere(2012) Europe
End to-end W3C - JS.everywhere(2012) Europe
Alexandre Morgaut
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
Eduard Tomàs
 
Asp.net mvc 5 course module 1 overview
Asp.net mvc 5 course   module 1 overviewAsp.net mvc 5 course   module 1 overview
Asp.net mvc 5 course module 1 overview
Sergey Seletsky
 
Full stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choiceFull stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choice
FDConf
 
Performance testing with VSTs on- and off-premises
Performance testing with VSTs on-  and off-premisesPerformance testing with VSTs on-  and off-premises
Performance testing with VSTs on- and off-premises
Jeff Bramwell
 
ActiveMQ Performance Tuning
ActiveMQ Performance TuningActiveMQ Performance Tuning
ActiveMQ Performance Tuning
Christian Posta
 
La vita nella corsia di sorpasso; A tutta velocità, XPages!
La vita nella corsia di sorpasso; A tutta velocità, XPages!La vita nella corsia di sorpasso; A tutta velocità, XPages!
La vita nella corsia di sorpasso; A tutta velocità, XPages!
Ulrich Krause
 
Modern javascript
Modern javascriptModern javascript
Modern javascript
Kevin Ball
 
Web application I have always dreamt of
Web application I have always dreamt ofWeb application I have always dreamt of
Web application I have always dreamt of
Victor_Cr
 
Saving Time By Testing With Jest
Saving Time By Testing With JestSaving Time By Testing With Jest
Saving Time By Testing With Jest
Ben McCormick
 
Integration Testing with Selenium
Integration Testing with SeleniumIntegration Testing with Selenium
Integration Testing with Selenium
All Things Open
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscape
Radosław Scheibinger
 
Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"
Provectus
 
Jasmine - A BDD test framework for JavaScript
Jasmine - A BDD test framework for JavaScriptJasmine - A BDD test framework for JavaScript
Jasmine - A BDD test framework for JavaScript
Sumanth krishna
 
CQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and DeploymentCQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and Deployment
klcodanr
 
Micronaut Deep Dive - Devnexus 2019
Micronaut Deep Dive - Devnexus 2019Micronaut Deep Dive - Devnexus 2019
Micronaut Deep Dive - Devnexus 2019
graemerocher
 
Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications
Paul Withers
 
End to-end W3C - JS.everywhere(2012) Europe
End to-end W3C - JS.everywhere(2012) EuropeEnd to-end W3C - JS.everywhere(2012) Europe
End to-end W3C - JS.everywhere(2012) Europe
Alexandre Morgaut
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
Eduard Tomàs
 
Asp.net mvc 5 course module 1 overview
Asp.net mvc 5 course   module 1 overviewAsp.net mvc 5 course   module 1 overview
Asp.net mvc 5 course module 1 overview
Sergey Seletsky
 
Full stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choiceFull stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choice
FDConf
 
Performance testing with VSTs on- and off-premises
Performance testing with VSTs on-  and off-premisesPerformance testing with VSTs on-  and off-premises
Performance testing with VSTs on- and off-premises
Jeff Bramwell
 
ActiveMQ Performance Tuning
ActiveMQ Performance TuningActiveMQ Performance Tuning
ActiveMQ Performance Tuning
Christian Posta
 
La vita nella corsia di sorpasso; A tutta velocità, XPages!
La vita nella corsia di sorpasso; A tutta velocità, XPages!La vita nella corsia di sorpasso; A tutta velocità, XPages!
La vita nella corsia di sorpasso; A tutta velocità, XPages!
Ulrich Krause
 

Viewers also liked (13)

Building a Progressive Web App
Building a  Progressive Web AppBuilding a  Progressive Web App
Building a Progressive Web App
Ido Green
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
Toninho Sousa
 
GDG Ibadan #pwa
GDG Ibadan #pwaGDG Ibadan #pwa
GDG Ibadan #pwa
Gbolahan Alli
 
Introduction to Progressive Web App
Introduction to Progressive Web AppIntroduction to Progressive Web App
Introduction to Progressive Web App
Binh Bui
 
Offline-First Progressive Web Apps
Offline-First Progressive Web AppsOffline-First Progressive Web Apps
Offline-First Progressive Web Apps
Aditya Punjani
 
Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016
Abdelrahman Omran
 
Progressive Web Applications
Progressive Web ApplicationsProgressive Web Applications
Progressive Web Applications
Bartek Igielski
 
Progressive Web Apps For Startups
Progressive Web Apps For StartupsProgressive Web Apps For Startups
Progressive Web Apps For Startups
Ido Green
 
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
Robert Nyman
 
Introduction to Progressive web app (PWA)
Introduction to Progressive web app (PWA)Introduction to Progressive web app (PWA)
Introduction to Progressive web app (PWA)
Zhentian Wan
 
Progressive Web Apps: o melhor da Web appficada
Progressive Web Apps: o melhor da Web appficadaProgressive Web Apps: o melhor da Web appficada
Progressive Web Apps: o melhor da Web appficada
Caelum
 
Why Progressive Web App is what you need for your Business
Why Progressive Web App is what you need for your BusinessWhy Progressive Web App is what you need for your Business
Why Progressive Web App is what you need for your Business
Lets Grow Business
 
Developing a Progressive Mobile Strategy
Developing a Progressive Mobile StrategyDeveloping a Progressive Mobile Strategy
Developing a Progressive Mobile Strategy
Dave Olsen
 
Building a Progressive Web App
Building a  Progressive Web AppBuilding a  Progressive Web App
Building a Progressive Web App
Ido Green
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
Toninho Sousa
 
Introduction to Progressive Web App
Introduction to Progressive Web AppIntroduction to Progressive Web App
Introduction to Progressive Web App
Binh Bui
 
Offline-First Progressive Web Apps
Offline-First Progressive Web AppsOffline-First Progressive Web Apps
Offline-First Progressive Web Apps
Aditya Punjani
 
Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016
Abdelrahman Omran
 
Progressive Web Applications
Progressive Web ApplicationsProgressive Web Applications
Progressive Web Applications
Bartek Igielski
 
Progressive Web Apps For Startups
Progressive Web Apps For StartupsProgressive Web Apps For Startups
Progressive Web Apps For Startups
Ido Green
 
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
Robert Nyman
 
Introduction to Progressive web app (PWA)
Introduction to Progressive web app (PWA)Introduction to Progressive web app (PWA)
Introduction to Progressive web app (PWA)
Zhentian Wan
 
Progressive Web Apps: o melhor da Web appficada
Progressive Web Apps: o melhor da Web appficadaProgressive Web Apps: o melhor da Web appficada
Progressive Web Apps: o melhor da Web appficada
Caelum
 
Why Progressive Web App is what you need for your Business
Why Progressive Web App is what you need for your BusinessWhy Progressive Web App is what you need for your Business
Why Progressive Web App is what you need for your Business
Lets Grow Business
 
Developing a Progressive Mobile Strategy
Developing a Progressive Mobile StrategyDeveloping a Progressive Mobile Strategy
Developing a Progressive Mobile Strategy
Dave Olsen
 
Ad

Similar to Gwt overview & getting started (20)

GWT-Basics
GWT-BasicsGWT-Basics
GWT-Basics
tutorialsruby
 
GWT-Basics
GWT-BasicsGWT-Basics
GWT-Basics
tutorialsruby
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
WebStackAcademy
 
Swagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlierSwagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlier
Miroslav Resetar
 
GWT HJUG Presentation
GWT HJUG PresentationGWT HJUG Presentation
GWT HJUG Presentation
Derrick Bowen
 
SSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJSSSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJS
Eugene Lazutkin
 
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript FrameworksBuilding Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
FITC
 
JavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform appsJavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform apps
Timmy Kokke
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
Ryan Cuprak
 
State of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront ConferenceState of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront Conference
dmethvin
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVM
Ryan Cuprak
 
Top 10 web application development frameworks 2016
Top 10 web application development frameworks 2016Top 10 web application development frameworks 2016
Top 10 web application development frameworks 2016
iMOBDEV Technologies Pvt. Ltd.
 
Dropwizard and Groovy
Dropwizard and GroovyDropwizard and Groovy
Dropwizard and Groovy
tomaslin
 
Gwt Presentation1
Gwt Presentation1Gwt Presentation1
Gwt Presentation1
rajakumar.tu
 
5 Treding Java Frameworks Offshore Developers Should About
5 Treding Java Frameworks Offshore Developers Should About5 Treding Java Frameworks Offshore Developers Should About
5 Treding Java Frameworks Offshore Developers Should About
BJIT Ltd
 
Comparison of-angular-8 vs react-js
Comparison of-angular-8 vs react-jsComparison of-angular-8 vs react-js
Comparison of-angular-8 vs react-js
easyjobworld
 
01 java intro
01 java intro01 java intro
01 java intro
Deepal Shah
 
Benefits of an Open environment with Wakanda
Benefits of an Open environment with WakandaBenefits of an Open environment with Wakanda
Benefits of an Open environment with Wakanda
Alexandre Morgaut
 
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Conference
 
JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014
Ryan Cuprak
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
WebStackAcademy
 
Swagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlierSwagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlier
Miroslav Resetar
 
GWT HJUG Presentation
GWT HJUG PresentationGWT HJUG Presentation
GWT HJUG Presentation
Derrick Bowen
 
SSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJSSSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJS
Eugene Lazutkin
 
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript FrameworksBuilding Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
FITC
 
JavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform appsJavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform apps
Timmy Kokke
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
Ryan Cuprak
 
State of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront ConferenceState of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront Conference
dmethvin
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVM
Ryan Cuprak
 
Dropwizard and Groovy
Dropwizard and GroovyDropwizard and Groovy
Dropwizard and Groovy
tomaslin
 
5 Treding Java Frameworks Offshore Developers Should About
5 Treding Java Frameworks Offshore Developers Should About5 Treding Java Frameworks Offshore Developers Should About
5 Treding Java Frameworks Offshore Developers Should About
BJIT Ltd
 
Comparison of-angular-8 vs react-js
Comparison of-angular-8 vs react-jsComparison of-angular-8 vs react-js
Comparison of-angular-8 vs react-js
easyjobworld
 
Benefits of an Open environment with Wakanda
Benefits of an Open environment with WakandaBenefits of an Open environment with Wakanda
Benefits of an Open environment with Wakanda
Alexandre Morgaut
 
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Conference
 
JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014
Ryan Cuprak
 
Ad

Recently uploaded (20)

Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Unit 4: Long term- Capital budgeting and its types
Unit 4: Long term- Capital budgeting and its typesUnit 4: Long term- Capital budgeting and its types
Unit 4: Long term- Capital budgeting and its types
bharath321164
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Envenomation---Clinical Toxicology. pptx
Envenomation---Clinical Toxicology. pptxEnvenomation---Clinical Toxicology. pptx
Envenomation---Clinical Toxicology. pptx
rekhapositivity
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
Diabetic neuropathy peripheral autonomic
Diabetic neuropathy peripheral autonomicDiabetic neuropathy peripheral autonomic
Diabetic neuropathy peripheral autonomic
Pankaj Patawari
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Unit 4: Long term- Capital budgeting and its types
Unit 4: Long term- Capital budgeting and its typesUnit 4: Long term- Capital budgeting and its types
Unit 4: Long term- Capital budgeting and its types
bharath321164
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Envenomation---Clinical Toxicology. pptx
Envenomation---Clinical Toxicology. pptxEnvenomation---Clinical Toxicology. pptx
Envenomation---Clinical Toxicology. pptx
rekhapositivity
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
Diabetic neuropathy peripheral autonomic
Diabetic neuropathy peripheral autonomicDiabetic neuropathy peripheral autonomic
Diabetic neuropathy peripheral autonomic
Pankaj Patawari
 

Gwt overview & getting started

  • 1. The Google Web Toolkit (GWT) Overview & Getting Started [email protected] 2014/5 1
  • 2. Topics in This Section ๏ What GWT is all about • Why(Love Story :D) • Advantages • Disadvantages ๏ Installing GWT • Core GWT • Eclipse plugin • Browser plugin ๏ Making a project • Using Eclipse plugin ๏ Testing process 2
  • 4. Why Web Apps(MVC)? • Downsides to browser-based apps • GUI is poor • HTML is OK for static documents, but lousy for programs • Communication is inefficient • HTTP is poor protocol for the way we now use Web apps 4
  • 5. Why Web Apps(MVC)? (Continued) • So why does everyone want Web apps? • Universal access • Everyone already has a browser installed • Any computer on the network can access content • Automatic “updates” (MVC) • Content comes from server, so is never out of date 5
  • 6. Why Ajax? • Solve three key problems of Web apps • Coarse-grained updates • Synchronous: you are frozen while waiting for result • Extremely limited options for widgets (GUI elements) • Still browser based • Ajax is about “what is the best you can do with what everyone already has in their browser?” • “Real” browser-based active content • Failed: Java Applets • Not universally supported; can’t interact with the HTML • Serious alternative: Flash/Flex • Not preinstalled on all PCs; not available for iPhone/iPad • Less proven • Microsoft Silverlight • JavaFX 6
  • 7. Ajax Problems • At least two languages are required • JavaScript on the client • Java or another language on the server • Invoking server is cumbersome • Even with JSON-RPC, DWR, or jQuery support • Want more powerful RPC mechanism • JavaScript scales poorly to large projects • No strong typing • Weak object hierarchies • Many run-time errors instead of compile-time errors • Incompatibility across platforms • Can’t use preexisting Java libraries or utilities 7
  • 8. Overview of the Google Web Toolkit (GWT) • Big Idea • You write both client-side and server-side code in Java • Client-side code • Uses an API similar to Swing • Most basic JDK 1.6 constructs and classes supported • Gets compiled into JavaScript that runs in your browser • Server-side code • Client uses a callback API and specifies data source URL • Once you define callback, you are mostly using regular Java method calls with complex arguments and return values • Server extends special class and defines regular methods • These are not servlet-style doBlah methods linked to HTTP • Arguments and return values can b • » Primitives, strings, arrays, a few java.util collections, Serializable custom classes 8
  • 9. Sites that Use GWT • Google Sites • Apache Wave, Google Base, • Google Checkout, • Google Moderator • Google Web • Google AdSense • Outside Sites • phuongbook.com :D 9
  • 10. Advantages of GWT • No JavaScript syntax errors • Use a reliable, strongly-typed language (Java) for development and debugging • No JavaScript programming at all! • Can use complex Java on the client • Turned into JavaScript, but you still use String, array, Math class, ArrayList, HashMap, custom classes, etc. • Full IDE-based Java support for development and debugging • Your client-side code can share data structures with your server-side code 10
  • 11. Advantages of GWT (Continued) • Can send complex Java types to/from the server • Real Java objects gets serialized across network. • More powerful and convenient approach than JSON-RPC • Standalone test environment • Can test within Eclipse without installing a new server • Support by a major company • Supported by the company that popularized Ajax in the first place • Support won’t go away like perhaps with AjaxTags 11
  • 12. Advantages of GWT (Continued) • Faster Apps • GWT uses deferred binding • Sends exactly the right code for the user’s circumstances • User agent • Locale • Debug vs. production • Network characteristics • Java is not compiled “blindly” into JavaScript • Many advanced compiler design techniques are used to make everything faster 12
  • 13. Disadvantages of GWT • Nonstandard approach to HTML & JavaScript • Programmatic creation of HTML can make use of standard HTML and CSS tools more difficult. • You never explicitly put JavaScript in your HTML. • Very powerful in the long run; hard to get used to at first. • Not search engine friendly • Google and others won’t index the dynamic content 13
  • 14. Disadvantages of GWT (Continued) • Only for Java developers • Most Ajax environments do JavaScript on the client and have a choice for the server. GWT is based entirely around Java. • GWT does support “normal” Ajax requests, but if you didn’t plan to mostly use Java on server, would you choose GWT in the first place? • Can’t(hard) make use of the good features of JavaScript • Fast prototyping, functional programming, easy DOM querying and manipulation (e.g., with jQuery) • Unusual approach • Fundamentally different strategy than all other Ajax tools makes evaluation and management buyoff harder 14
  • 16. Installation: Overview • Install Eclipse Plugin • https://developers.google.com/eclipse/docs/getting_started • Choose to install the GWT SDK at the same time • Install Browser Plugin • The first time you run in a browser in development mode, it will prompt you to install browser plugin. • See details in section on running in Production Mode • (Optional) Install GWT SDK • https://developers.google.com/web-toolkit/download • Download ZIP file and unzip into folder of your choice • Optional because you can get it bundled with Eclipse plugin • (Optional) Install Speed Tracer • Performance profiler. See top-level download page from first bullet. Not discussed here. 16
  • 17. Making a project - Demo 17
  • 19. Testing the Project in Development Mode 19
  • 20. Testing Project in Production Mode 20
  • 21. Deploying the Project to Normal Java App Server 21