Gwt Presentation1

Embed Size (px)

Text of Gwt Presentation1

  • GWT A 'new' way to program dynamic web applications - Usman- Pavan - Rajakumar

  • Overview of AJAX developmentProblems with AJAXWhat is GWT ? Why GWT ?Sample applicationUser Interface with GWTRPCCons


  • Classic web application model (synchronous)

  • Ajax web application model (asynchronous)

  • Asynchronous JavaScript and XML (AJAX)Server - sideClient sideJavascriptJAVA+ no page transition, no blocking No IDE Debugging is difficult weakly typed

    + eclipse: debugging, easy development good IDEs Debugging is easy strongly typed

  • AJAX

    Asynchronous JavaScript and XML.

    Clientside javascript to asynchronously fetch the data

    Using the DOM API dynamically modify the page

    Based on javascript,html,xml,css.xhtml,DOM.

    Web browser UI to be more interactive and to respond quickly to inputs

  • Drawbacks

    Multiple languages and framework across stackMixing the js,jsp,xml,java leads maintenance problemLess modularizationLess reusable codeBreaks MVC principle.Complicated debugging and testing with different browsers.Browsers back button and history maintains problemOOPS

  • What is GWT ?A FrameWork for building highly perfomant, Ajax enabled , Javascript front-end web applications .

    Provides Java-to-javaScirpt Compiler .Allow to use the java development tools like netbeans and eclipse.Shell to test and debug modules without compilationSimple asynchronous browser-to-server RPC

  • Why GWT ?Rich user InterfaceOpen sourceNo need to learn Javascript languageNo need to learn DOM Api( use java Api)No plugIns required in client sideJunit integration

  • Why GWT ? (Cont ... )

    OOPSAsynchronous CallsTo share load between client and server Keeping only insensitive data on client side Not for validation but for the better and rich user interface.

  • GWT Application Architecture

  • Modes of Running Gwt application

    Gwt Application can run in two modes .

    Host ModeHosted Mode is a 'simulated' mode Run entirely from Eclipse using the GWT Shell.

    * Consists of a customized Tomcat Web container. * Makes debugging easier . Web ModeRun as pure JavaScript and HTML,compiled from your original Java source code with the GWT

  • Google Web Toolkit (GWT)@ deployment time@ development time


    [...]"POST", url, true);xmlhttp.onreadystatechange = function(func) { if (xmlhttp.readyState == 4) { [...] }}xmlhttp.setRequestHeader('MessageType', 'CALL');xmlhttp.setRequestHeader('Content-Type', 'text/xml');


    JAVA/eclipsejavascriptHosted modeJVMIDECompile to JAVA bytecodeCompile toJavascript

  • GWT: project structure

    PackagePurposeit/sella/gwt/The project root package contains module XML files it/sella/gwt/client/Client-side source files and subpackagesit/sella/gwt/server/Server-side code and subpackages it/sella/gwt/public/ Static resources that can be served publicly

  • GWT Modules


    Jsp,Html, ...

    Entry point class (java class)

    Css , Images ,other xmls

    External java script file

  • UI widget library


    These are Asynchronous Calls.

    A framework used to exchange java objects .

    Based on the java servlet architecture .

    GWT handle the serialization of java objects.

    GWT-RPC services are not same as web services . .

  • RPC plumbing diagram

  • Corns of GWTBrowser compatibility pretty good but issues with some browsers.Although java to javascript convertion takes place, not all features of java can be implemented .eg multi threading,Calender etc Gwt generated javascript and html are very difficult to understand .Layouts,panels and some widgets have bugs .

  • Corns of GWT ( Cont... )

    The appearance of the application depends on the browser.Take long time to load and heavily uses the client resources.

  • ReferenceDocumentation & Tutorial :