SlideShare a Scribd company logo
1 of 32
GWT training session I

Developing Ajax Web
Apps with GWT

Snehal Masne
www.TechProceed.com
Contents


Introduction










Traditional Web
RIAs
Emergence of Ajax

Ajax
Google Web Toolkit (GWT)‫‏‬
Installing and Setting up GWT in Eclipse
The Project Structure
Running the Application
www.TechProceed.com
Introduction


The traditional web







Document oriented
Web Apps

Rich Internet Applications (RIAs)‫‏‬
Emergence of Ajax






XHTML, CSS
Javascript
Document formats – XML, JSON
RIAs
Webservices

www.TechProceed.com
The Traditional Web


Document Oriented






In 1991, Tim Berners Lee invented the web for
the purpose of sharing documents easily
Hypertext Markup Language (HTML)‫‏‬
Cascading Style Sheet (CSS)‫‏‬

Web Apps




Web starts advancing to applications, e.g Yahoo
in 1994
Communication with server through CGI (Perl
script)‫‏‬
Forms, Javascript
www.TechProceed.com
Rich Internet Applications
(RIAs)‫‏‬


Adobe Flash and Flex







Microsoft Silverlight




Most successful browser plugin—installed on 98 percent of Internet-enabled
desktops.
Relatively small download size and fast performance
Graphic-designer-friendly development tool used to construct SWF files.
Flex is geared toward software developers and provides data services such
as remoting and messaging solutions to communicate to a Java 2 Enterprise
Edition (J2EE) server.

Announced by Microsoft in 2007 its own RIA

JavaFX



Sun Microsystems announced Java FX at JavaOne in May 2007,
Consists of a Script and a Mobile module that run on a standard JRE
www.TechProceed.com
Emergence of Ajax
















XHMTL
Similar expression to HTML but also conforms to XML
CSS
Language used to describe the presentation of document written in markup language
comonly HTML
Javascript
Client side scripting language interpreted by the browser
 Netscape (ECMA Script)‫‏‬
DOM (Document Object Model)
Model for representing and interacting with objects in HTML, XHTML and XML documents
XML
General-purpose specification for creating custom markup languages
XMLHttpRequest
(Javascript) API used to send an HTTP request directly to a web server and load the
server response data directly back into the scripting language
Webservices
Web based applications that use open, XML-based standards and transport protocols to
exchange data with clients
Ajax Libraries
Dojo toolkit, Scriptaculous, Yahoo User Interface (YUI) library
www.TechProceed.com
Asynchronous Javascript and
XML (Ajax)‫‏‬
In February 2005, Jesse James Garrett of Adaptive Path coined the
term Ajax (Asynchronous JavaScript and XML)




Ajax comprises of a set of technologies which made it possible

for web applications to be interactive and rich close to that of desktop

applications. Each individual element of a web page can be updated
without reloading the entire page.

www.TechProceed.com
Traditional Web Application
Interaction with the Server

Source: Deitel and Deitel; Ajax, Rich Internet Applications and Web Development for Programmers; 2008

www.TechProceed.com
Ajax-based Web Application
Interaction with the Server

Source: Deitel and Deitel; Ajax, Rich Internet Applications and Web Development for Programmers; 2008

www.TechProceed.com
Example of Ajax-based
Applications







Google Maps
Gmail
New Yahoo Mail
Facebook, Facebook Chat
Youtube

www.TechProceed.com
GWT (Google Web Toolkit)‫‏‬


With the increase use of Ajax technologies to develop rich Internet applications, re-usability and

maintenance becomes necessary


Difficult to achieve with raw Ajax technologies



JavaScript code compatibility issues across all platforms



Non-typed nature of JavaScript makes it difficult for write and debug instantly.



GWT is launched in May 2006 by Google to address these issues



It is a set of development tools, programming utilities and widgets for developing Ajax-based rich
Internet applications using Java
instead of JavaScript. GWT then cross-compiles the Java code into optimized JavaScript that
automatically works across all major browsers



Can be debugged and stepped through line by line.



The Java source code is compiled into stand-alone JavaScript files .

www.TechProceed.com
GWT cont'd




Existing JavaScript libraries can be included
Native Javascript codes can also be included using Javascript Native Interface
(JSNI)



Only web standards; doesn't require any new runtimes or plugins.



Provides libraries that simplifies communication with server-side technologies





Code re-usability, management and maintenance were thus achieved just as
any other Java code would be.
The current version of GWT is 1.6.

www.TechProceed.com
GWT and Software Engineering










Model
From the developers' perspective, building Ajax-based Web Applications is like building
any other Java Application (very similar to Swing applications). The object oriented nature
of Java thus makes it possible to use models llike UML in analysis and design
Documentation
Standard-based documentations can be used

Tools
Application development process can leverage high-quality software engineering tools
such as JUnit for test-driven development and IDEs like Eclipse that provide superior
debugging support and compile-time error checking on the fly.
Re-usability
Re-usable widgets for user interface can be created
Maintainability
Maintainable codes can be developed through the use of object oriented design patterns.

www.TechProceed.com
GWT Showcase




http://ongwt.googlecode.com/svn/trunk/com.g
oogle.gwt.sample.showcase.Showcase/Sho
wcase.html

Smart GWT showcase – Rich widgets built
using GWT
http://www.smartclient.com/smartgwt/showca
se/

www.TechProceed.com
Benefits of GWT in Summary








Building Rich Interfaces with Widgets and
Panels
Getting Better Performance with
Asynchronous Communication
Providing interoperation through Web
Standards and Web Services
Speeding Development Using Java Tools

www.TechProceed.com
Installing and Setting up GWT






In this tutorial we would setup and install GWT 1.6, the latest
version released in April, 2009.
Eclipse IDE and GWT plugin for Eclipse would be used.
Java Development Kit (JDK) 1.5 or higher is required
Download URLs
 JDK (http://java.sun.com/javase/downloads)‫‏‬
 Eclipse 3.4 Ganymede IDE
(http://www.eclipse.org/downloads/)‫‏‬
 GWT
 Google Eclipse Plugin
(http://code.google.com/eclipse/docs/install-eclipse-3.4.html)*
* We would install GWT and the plugin using the Eclipse IDE Software updater tool, so you don't need to download
both the GWT and the plugin separately

www.TechProceed.com
Installing JDK and Eclipse




It is assumed that you already have JDK 1.5
or higher installed on your system. If it is not
installed, you may download and install from
this URL (http://java.sun.com/javase/downloads)
Also download Eclipse from http://www.eclipse.org/downloads/
and extract it in any location.

Note: For the purpose of this training, all required applications are available in the CD provided.

www.TechProceed.com
Running Eclipse


You can start the IDE by clicking on the eclipse executable file
located in the eclipse folder you extracted.

www.TechProceed.com
Installing the Google Plugin


This installation notes are extracted from the GWT website:
http://code.google.com/eclipse/docs/install-eclipse-3.4.html

www.TechProceed.com
Installing the Google Plugin – cont’d

www.TechProceed.com
Installing the Google Plugin – cont’d

www.TechProceed.com
Installing the Google Plugin – cont’d

www.TechProceed.com
Installing the Google Plugin – cont’d

www.TechProceed.com
Installing the Google Plugin – cont’d

www.TechProceed.com
Creating a New Project with
Eclipse












Select File > New > Web
Application Project
Input GWTTraining in the Project
name field
Input my.utm.kase.gwttraining in
the Package field
Leave the location as the default
(Create new project in workspace)‫‏‬
Uncheck the Use Google App
Engine (This only appears if you
have installed the Google App
Engine plugin for Eclipse)‫‏‬
Click Finish to create the project.

www.TechProceed.com
The Project Structure






The GWTTraining project is shown in
the Package Explorer
Expand the GWTTraining to view the
contents of the project structure
Four items are created for the
project:

src: Source files

GWT SDK: GWT libraries

JRE System Library: Java
Runtime library

war:

www.TechProceed.com
The src Folder








The src folder contains the main GWT
configuration file for the project and source
codes.
The configuration file (GWTTraining.gwt.xml)
is located under the main package,
my.utm.kase.gwttraining.
A package for client-related codes is created
under the main package
(my.utm.kase.gwttraining.client). All client
codes are required to be in this package.
A package for server-related codes is created
under the main package
(my.utm.kase.gwttraining.server). This is the
default created by Eclipse, but it is not
mandatory.

www.TechProceed.com
GWT Application Configuration
file








This‫‏‬file‫‏‬specifies‫‏‬the‫‏‬application’s‫‏‬
configuration options for the GWT
compiler
The com.google.gwt.user.User
module is inherited which is
required for the User Interface
com.google.gwwt.usser.theme.sta
ndard.Standard is specified to be
used as the theme for this
application. You may select the
Chrome or Dark theme by uncommenting the corresponding
<inherits> tag.
The GWT compiler needs to know
the entry-point of the application
(i.e. main class). This is specified
in the <entry-point> tag.

www.TechProceed.com
The war Folder












The war folder structured in the standard Java web
app "expanded war" format to simplify application
deployment.
It contains the compiler output and handwritten static
resources that should be included included in the web
application alongside GWT modules.
The file /war/WEB-INF/web.xml is used for configuring
server-side codes using the standard Java servlet
configuration.
Libraries used in the server-side are placed in the into
/war/WEB-INF/lib folder. The gwt-servlet.jar is required
for the GWT RPC servlets.
GWTTraining.css and GWTTraining.html are static
files for the apllications' main style definition and html
respectively.
Further reading
(http://code.google.com/webtoolkit/doc/1.6/ReleaseNot
es_1_6.html)‫‏‬

www.TechProceed.com
Running the Application







Select GWTTraining from the Package
Explorer
Click the Run button (
) on the toolbar
The Application is run on a hosted mode
for easy debugging and testing which be
deployed to the main server that will host it
when ready.
Two windows are displayed: the log
window which displays information about
the running application and a browser that
runs the application

www.TechProceed.com
Running the Application – cont’d




You may try the application by entering
your name and clicking enter.
A dialog box displaying the server version
and browser information would be
displayed

www.TechProceed.com
End of Session I




Session II of this tutorial would take us
through building the client side of Web
application using GWT. We would explore
the available user interface widgets available
in GWT library and learn how to use them.

Thank you.

www.TechProceed.com

More Related Content

What's hot

MicroProfile for MicroServices
MicroProfile for MicroServicesMicroProfile for MicroServices
MicroProfile for MicroServicesMert Çalışkan
 
From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedsparkfabrik
 
Vaadin and Spring at Devoxx UK 2015
Vaadin and Spring at Devoxx UK 2015Vaadin and Spring at Devoxx UK 2015
Vaadin and Spring at Devoxx UK 2015Sami Ekblad
 
jDays2015 - JavaEE vs. Spring Smackdown
jDays2015 - JavaEE vs. Spring SmackdownjDays2015 - JavaEE vs. Spring Smackdown
jDays2015 - JavaEE vs. Spring SmackdownMert Çalışkan
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Stephen Chin
 
Top 8 benefits of react js
Top 8 benefits of react jsTop 8 benefits of react js
Top 8 benefits of react jsRani Sinha
 
JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014Ryan Cuprak
 
Java EE and Spring Side-by-Side
Java EE and Spring Side-by-SideJava EE and Spring Side-by-Side
Java EE and Spring Side-by-SideReza Rahman
 
Html5 with Vaadin and Scala
Html5 with Vaadin and ScalaHtml5 with Vaadin and Scala
Html5 with Vaadin and ScalaJoonas Lehtinen
 
Creating modern java web applications based on struts2 and angularjs
Creating modern java web applications based on struts2 and angularjsCreating modern java web applications based on struts2 and angularjs
Creating modern java web applications based on struts2 and angularjsJohannes Geppert
 
5 best Java Frameworks
5 best Java Frameworks5 best Java Frameworks
5 best Java FrameworksAegis Softtech
 
Moving To The Client - JavaFX and HTML5
Moving To The Client - JavaFX and HTML5Moving To The Client - JavaFX and HTML5
Moving To The Client - JavaFX and HTML5Stephen Chin
 
MicroProfile: Optimizing Java EE for a Microservices Architecture
MicroProfile: Optimizing Java EE for a Microservices ArchitectureMicroProfile: Optimizing Java EE for a Microservices Architecture
MicroProfile: Optimizing Java EE for a Microservices Architecturejclingan
 
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019Matt Raible
 
Flash Platformアップデート
Flash PlatformアップデートFlash Platformアップデート
Flash PlatformアップデートMariko Nishimura
 
Grails At Linked
Grails At LinkedGrails At Linked
Grails At LinkedLinkedIn
 
Community vs. Commercial Open Source
Community vs. Commercial Open SourceCommunity vs. Commercial Open Source
Community vs. Commercial Open SourceJustin Reock
 

What's hot (20)

MicroProfile for MicroServices
MicroProfile for MicroServicesMicroProfile for MicroServices
MicroProfile for MicroServices
 
From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I started
 
Vaadin and Spring at Devoxx UK 2015
Vaadin and Spring at Devoxx UK 2015Vaadin and Spring at Devoxx UK 2015
Vaadin and Spring at Devoxx UK 2015
 
Angularj2.0
Angularj2.0Angularj2.0
Angularj2.0
 
jDays2015 - JavaEE vs. Spring Smackdown
jDays2015 - JavaEE vs. Spring SmackdownjDays2015 - JavaEE vs. Spring Smackdown
jDays2015 - JavaEE vs. Spring Smackdown
 
Frameworks in java
Frameworks in javaFrameworks in java
Frameworks in java
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5
 
Top 8 benefits of react js
Top 8 benefits of react jsTop 8 benefits of react js
Top 8 benefits of react js
 
JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014
 
Java EE and Spring Side-by-Side
Java EE and Spring Side-by-SideJava EE and Spring Side-by-Side
Java EE and Spring Side-by-Side
 
Html5 with Vaadin and Scala
Html5 with Vaadin and ScalaHtml5 with Vaadin and Scala
Html5 with Vaadin and Scala
 
Creating modern java web applications based on struts2 and angularjs
Creating modern java web applications based on struts2 and angularjsCreating modern java web applications based on struts2 and angularjs
Creating modern java web applications based on struts2 and angularjs
 
5 best Java Frameworks
5 best Java Frameworks5 best Java Frameworks
5 best Java Frameworks
 
Moving To The Client - JavaFX and HTML5
Moving To The Client - JavaFX and HTML5Moving To The Client - JavaFX and HTML5
Moving To The Client - JavaFX and HTML5
 
MicroProfile: Optimizing Java EE for a Microservices Architecture
MicroProfile: Optimizing Java EE for a Microservices ArchitectureMicroProfile: Optimizing Java EE for a Microservices Architecture
MicroProfile: Optimizing Java EE for a Microservices Architecture
 
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
 
Vaadin & Web Components
Vaadin & Web ComponentsVaadin & Web Components
Vaadin & Web Components
 
Flash Platformアップデート
Flash PlatformアップデートFlash Platformアップデート
Flash Platformアップデート
 
Grails At Linked
Grails At LinkedGrails At Linked
Grails At Linked
 
Community vs. Commercial Open Source
Community vs. Commercial Open SourceCommunity vs. Commercial Open Source
Community vs. Commercial Open Source
 

Viewers also liked

Viewers also liked (13)

Sistemas de Información Institucional Uniminuto
Sistemas de Información Institucional UniminutoSistemas de Información Institucional Uniminuto
Sistemas de Información Institucional Uniminuto
 
Slide Share
Slide ShareSlide Share
Slide Share
 
Prueba unica miguel angel oquendo 7.b
Prueba unica miguel angel oquendo 7.bPrueba unica miguel angel oquendo 7.b
Prueba unica miguel angel oquendo 7.b
 
ServiceGold
ServiceGoldServiceGold
ServiceGold
 
Grand event without error
Grand event without errorGrand event without error
Grand event without error
 
Sonet
SonetSonet
Sonet
 
Análsis E-Commerce
Análsis E-CommerceAnálsis E-Commerce
Análsis E-Commerce
 
Ingenieria agronomica
Ingenieria agronomicaIngenieria agronomica
Ingenieria agronomica
 
Nevera Teka NFE2 320
Nevera Teka NFE2 320Nevera Teka NFE2 320
Nevera Teka NFE2 320
 
Dialoog
DialoogDialoog
Dialoog
 
The three little pigs
The three little pigsThe three little pigs
The three little pigs
 
Vocabulario de ingles welcome
Vocabulario de ingles welcomeVocabulario de ingles welcome
Vocabulario de ingles welcome
 
Rol del docente y la atención a la diversidad
Rol del docente y la atención a la diversidadRol del docente y la atención a la diversidad
Rol del docente y la atención a la diversidad
 

Similar to GWT training session 1

GWT Training - Session 1/3
GWT Training - Session 1/3GWT Training - Session 1/3
GWT Training - Session 1/3Faiz Bashir
 
GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day DNG Consulting
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
Asp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdfAsp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdfIntegrated IT Solutions
 
Google Web Toolkit Introduction - eXo Platform SEA
Google Web Toolkit Introduction - eXo Platform SEAGoogle Web Toolkit Introduction - eXo Platform SEA
Google Web Toolkit Introduction - eXo Platform SEAnerazz08
 
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitIMC Institute
 
Programming Server side with Sevlet
 Programming Server side with Sevlet  Programming Server side with Sevlet
Programming Server side with Sevlet backdoor
 
Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - IntroductionWebStackAcademy
 
Busy developer-html5-javaee7
Busy developer-html5-javaee7Busy developer-html5-javaee7
Busy developer-html5-javaee7Geertjan Wielenga
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologiesHosam Kamel
 
Front End Development | Introduction
Front End Development | IntroductionFront End Development | Introduction
Front End Development | IntroductionJohnTaieb
 
COMPRO- WEB ALBUM & MOTION ANALYZER
COMPRO- WEB ALBUM  & MOTION ANALYZERCOMPRO- WEB ALBUM  & MOTION ANALYZER
COMPRO- WEB ALBUM & MOTION ANALYZERAshish Tanwer
 
GWT + Gears : The browser is the platform
GWT + Gears : The browser is the platformGWT + Gears : The browser is the platform
GWT + Gears : The browser is the platformDidier Girard
 

Similar to GWT training session 1 (20)

GWT Training - Session 1/3
GWT Training - Session 1/3GWT Training - Session 1/3
GWT Training - Session 1/3
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
Google Cloud Platform
Google Cloud Platform Google Cloud Platform
Google Cloud Platform
 
GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day
 
Asp.net Vs Vue.js.pdf
Asp.net Vs Vue.js.pdfAsp.net Vs Vue.js.pdf
Asp.net Vs Vue.js.pdf
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Asp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdfAsp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdf
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
sveltekit-en.pdf
sveltekit-en.pdfsveltekit-en.pdf
sveltekit-en.pdf
 
Google Web Toolkit Introduction - eXo Platform SEA
Google Web Toolkit Introduction - eXo Platform SEAGoogle Web Toolkit Introduction - eXo Platform SEA
Google Web Toolkit Introduction - eXo Platform SEA
 
Reactjs Basics
Reactjs BasicsReactjs Basics
Reactjs Basics
 
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
 
Programming Server side with Sevlet
 Programming Server side with Sevlet  Programming Server side with Sevlet
Programming Server side with Sevlet
 
Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - Introduction
 
Busy developer-html5-javaee7
Busy developer-html5-javaee7Busy developer-html5-javaee7
Busy developer-html5-javaee7
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologies
 
Front End Development | Introduction
Front End Development | IntroductionFront End Development | Introduction
Front End Development | Introduction
 
COMPRO- WEB ALBUM & MOTION ANALYZER
COMPRO- WEB ALBUM  & MOTION ANALYZERCOMPRO- WEB ALBUM  & MOTION ANALYZER
COMPRO- WEB ALBUM & MOTION ANALYZER
 
Introduction to asp
Introduction to aspIntroduction to asp
Introduction to asp
 
GWT + Gears : The browser is the platform
GWT + Gears : The browser is the platformGWT + Gears : The browser is the platform
GWT + Gears : The browser is the platform
 

Recently uploaded

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Recently uploaded (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

GWT training session 1

  • 1. GWT training session I Developing Ajax Web Apps with GWT Snehal Masne www.TechProceed.com
  • 2. Contents  Introduction         Traditional Web RIAs Emergence of Ajax Ajax Google Web Toolkit (GWT)‫‏‬ Installing and Setting up GWT in Eclipse The Project Structure Running the Application www.TechProceed.com
  • 3. Introduction  The traditional web     Document oriented Web Apps Rich Internet Applications (RIAs)‫‏‬ Emergence of Ajax      XHTML, CSS Javascript Document formats – XML, JSON RIAs Webservices www.TechProceed.com
  • 4. The Traditional Web  Document Oriented     In 1991, Tim Berners Lee invented the web for the purpose of sharing documents easily Hypertext Markup Language (HTML)‫‏‬ Cascading Style Sheet (CSS)‫‏‬ Web Apps    Web starts advancing to applications, e.g Yahoo in 1994 Communication with server through CGI (Perl script)‫‏‬ Forms, Javascript www.TechProceed.com
  • 5. Rich Internet Applications (RIAs)‫‏‬  Adobe Flash and Flex      Microsoft Silverlight   Most successful browser plugin—installed on 98 percent of Internet-enabled desktops. Relatively small download size and fast performance Graphic-designer-friendly development tool used to construct SWF files. Flex is geared toward software developers and provides data services such as remoting and messaging solutions to communicate to a Java 2 Enterprise Edition (J2EE) server. Announced by Microsoft in 2007 its own RIA JavaFX   Sun Microsystems announced Java FX at JavaOne in May 2007, Consists of a Script and a Mobile module that run on a standard JRE www.TechProceed.com
  • 6. Emergence of Ajax         XHMTL Similar expression to HTML but also conforms to XML CSS Language used to describe the presentation of document written in markup language comonly HTML Javascript Client side scripting language interpreted by the browser  Netscape (ECMA Script)‫‏‬ DOM (Document Object Model) Model for representing and interacting with objects in HTML, XHTML and XML documents XML General-purpose specification for creating custom markup languages XMLHttpRequest (Javascript) API used to send an HTTP request directly to a web server and load the server response data directly back into the scripting language Webservices Web based applications that use open, XML-based standards and transport protocols to exchange data with clients Ajax Libraries Dojo toolkit, Scriptaculous, Yahoo User Interface (YUI) library www.TechProceed.com
  • 7. Asynchronous Javascript and XML (Ajax)‫‏‬ In February 2005, Jesse James Garrett of Adaptive Path coined the term Ajax (Asynchronous JavaScript and XML)   Ajax comprises of a set of technologies which made it possible for web applications to be interactive and rich close to that of desktop applications. Each individual element of a web page can be updated without reloading the entire page. www.TechProceed.com
  • 8. Traditional Web Application Interaction with the Server Source: Deitel and Deitel; Ajax, Rich Internet Applications and Web Development for Programmers; 2008 www.TechProceed.com
  • 9. Ajax-based Web Application Interaction with the Server Source: Deitel and Deitel; Ajax, Rich Internet Applications and Web Development for Programmers; 2008 www.TechProceed.com
  • 10. Example of Ajax-based Applications      Google Maps Gmail New Yahoo Mail Facebook, Facebook Chat Youtube www.TechProceed.com
  • 11. GWT (Google Web Toolkit)‫‏‬  With the increase use of Ajax technologies to develop rich Internet applications, re-usability and maintenance becomes necessary  Difficult to achieve with raw Ajax technologies  JavaScript code compatibility issues across all platforms  Non-typed nature of JavaScript makes it difficult for write and debug instantly.  GWT is launched in May 2006 by Google to address these issues  It is a set of development tools, programming utilities and widgets for developing Ajax-based rich Internet applications using Java instead of JavaScript. GWT then cross-compiles the Java code into optimized JavaScript that automatically works across all major browsers  Can be debugged and stepped through line by line.  The Java source code is compiled into stand-alone JavaScript files . www.TechProceed.com
  • 12. GWT cont'd   Existing JavaScript libraries can be included Native Javascript codes can also be included using Javascript Native Interface (JSNI)  Only web standards; doesn't require any new runtimes or plugins.  Provides libraries that simplifies communication with server-side technologies   Code re-usability, management and maintenance were thus achieved just as any other Java code would be. The current version of GWT is 1.6. www.TechProceed.com
  • 13. GWT and Software Engineering      Model From the developers' perspective, building Ajax-based Web Applications is like building any other Java Application (very similar to Swing applications). The object oriented nature of Java thus makes it possible to use models llike UML in analysis and design Documentation Standard-based documentations can be used Tools Application development process can leverage high-quality software engineering tools such as JUnit for test-driven development and IDEs like Eclipse that provide superior debugging support and compile-time error checking on the fly. Re-usability Re-usable widgets for user interface can be created Maintainability Maintainable codes can be developed through the use of object oriented design patterns. www.TechProceed.com
  • 14. GWT Showcase   http://ongwt.googlecode.com/svn/trunk/com.g oogle.gwt.sample.showcase.Showcase/Sho wcase.html Smart GWT showcase – Rich widgets built using GWT http://www.smartclient.com/smartgwt/showca se/ www.TechProceed.com
  • 15. Benefits of GWT in Summary     Building Rich Interfaces with Widgets and Panels Getting Better Performance with Asynchronous Communication Providing interoperation through Web Standards and Web Services Speeding Development Using Java Tools www.TechProceed.com
  • 16. Installing and Setting up GWT     In this tutorial we would setup and install GWT 1.6, the latest version released in April, 2009. Eclipse IDE and GWT plugin for Eclipse would be used. Java Development Kit (JDK) 1.5 or higher is required Download URLs  JDK (http://java.sun.com/javase/downloads)‫‏‬  Eclipse 3.4 Ganymede IDE (http://www.eclipse.org/downloads/)‫‏‬  GWT  Google Eclipse Plugin (http://code.google.com/eclipse/docs/install-eclipse-3.4.html)* * We would install GWT and the plugin using the Eclipse IDE Software updater tool, so you don't need to download both the GWT and the plugin separately www.TechProceed.com
  • 17. Installing JDK and Eclipse   It is assumed that you already have JDK 1.5 or higher installed on your system. If it is not installed, you may download and install from this URL (http://java.sun.com/javase/downloads) Also download Eclipse from http://www.eclipse.org/downloads/ and extract it in any location. Note: For the purpose of this training, all required applications are available in the CD provided. www.TechProceed.com
  • 18. Running Eclipse  You can start the IDE by clicking on the eclipse executable file located in the eclipse folder you extracted. www.TechProceed.com
  • 19. Installing the Google Plugin  This installation notes are extracted from the GWT website: http://code.google.com/eclipse/docs/install-eclipse-3.4.html www.TechProceed.com
  • 20. Installing the Google Plugin – cont’d www.TechProceed.com
  • 21. Installing the Google Plugin – cont’d www.TechProceed.com
  • 22. Installing the Google Plugin – cont’d www.TechProceed.com
  • 23. Installing the Google Plugin – cont’d www.TechProceed.com
  • 24. Installing the Google Plugin – cont’d www.TechProceed.com
  • 25. Creating a New Project with Eclipse       Select File > New > Web Application Project Input GWTTraining in the Project name field Input my.utm.kase.gwttraining in the Package field Leave the location as the default (Create new project in workspace)‫‏‬ Uncheck the Use Google App Engine (This only appears if you have installed the Google App Engine plugin for Eclipse)‫‏‬ Click Finish to create the project. www.TechProceed.com
  • 26. The Project Structure    The GWTTraining project is shown in the Package Explorer Expand the GWTTraining to view the contents of the project structure Four items are created for the project:  src: Source files  GWT SDK: GWT libraries  JRE System Library: Java Runtime library  war: www.TechProceed.com
  • 27. The src Folder     The src folder contains the main GWT configuration file for the project and source codes. The configuration file (GWTTraining.gwt.xml) is located under the main package, my.utm.kase.gwttraining. A package for client-related codes is created under the main package (my.utm.kase.gwttraining.client). All client codes are required to be in this package. A package for server-related codes is created under the main package (my.utm.kase.gwttraining.server). This is the default created by Eclipse, but it is not mandatory. www.TechProceed.com
  • 28. GWT Application Configuration file     This‫‏‬file‫‏‬specifies‫‏‬the‫‏‬application’s‫‏‬ configuration options for the GWT compiler The com.google.gwt.user.User module is inherited which is required for the User Interface com.google.gwwt.usser.theme.sta ndard.Standard is specified to be used as the theme for this application. You may select the Chrome or Dark theme by uncommenting the corresponding <inherits> tag. The GWT compiler needs to know the entry-point of the application (i.e. main class). This is specified in the <entry-point> tag. www.TechProceed.com
  • 29. The war Folder       The war folder structured in the standard Java web app "expanded war" format to simplify application deployment. It contains the compiler output and handwritten static resources that should be included included in the web application alongside GWT modules. The file /war/WEB-INF/web.xml is used for configuring server-side codes using the standard Java servlet configuration. Libraries used in the server-side are placed in the into /war/WEB-INF/lib folder. The gwt-servlet.jar is required for the GWT RPC servlets. GWTTraining.css and GWTTraining.html are static files for the apllications' main style definition and html respectively. Further reading (http://code.google.com/webtoolkit/doc/1.6/ReleaseNot es_1_6.html)‫‏‬ www.TechProceed.com
  • 30. Running the Application     Select GWTTraining from the Package Explorer Click the Run button ( ) on the toolbar The Application is run on a hosted mode for easy debugging and testing which be deployed to the main server that will host it when ready. Two windows are displayed: the log window which displays information about the running application and a browser that runs the application www.TechProceed.com
  • 31. Running the Application – cont’d   You may try the application by entering your name and clicking enter. A dialog box displaying the server version and browser information would be displayed www.TechProceed.com
  • 32. End of Session I   Session II of this tutorial would take us through building the client side of Web application using GWT. We would explore the available user interface widgets available in GWT library and learn how to use them. Thank you. www.TechProceed.com