Ajax and the GWT. Ajax  Asynchronous JavaScript And XML  Technology behind interactive web sites  Provide smoother experience than conventional web.

Slides:



Advertisements
Similar presentations
GWT - RPC. RPC plumbing diagram package com.mycompany.client; import com.google.gwt.user.client.rpc.RemoteService; public interface MyAddService extends.
Advertisements

Fawaz Ghali AJAX: Web Programming's Toy.
Web Toolkit Julie George & Ronald Lopez 1. Requirements  Java SDK version 1.5 or later  Apache Ant is also necessary to run command line arguments 
Introduction to JavaScript
AJAX Technologies KAUNAS UNIVERSITY OF TECHNOLOGY MODULE: INFORMATION TECHNOLOGY GROUP: IF - 4/9 GROUP: VENTILIATORIAI
1 GWT Google Web Toolkit Build AJAX apps in the Java language
P&O3: Tools & methodologies Stefaan Ternier. Overview TCP/IP Servlets Google Web Toolkit Google Maps JPDA.
1 Chapter 12 Working With Access 2000 on the Internet.
Google Web Toolkit - Gufran Mohammed. Google Web Toolkit (GWT) is an open source Java software development framework that makes writing AJAX applications.
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
Cloud Computing Lecture #7 Introduction to Ajax Jimmy Lin The iSchool University of Maryland Wednesday, October 15, 2008 This work is licensed under a.
Web Page Behavior IS 373—Web Standards Todd Will.
Does Ajax suck? CS575 Spring 2007 Chanwit Suebsureekul.
1 JavaScript & AJAX CS , Spring JavaScript.
ITM352 Javascript and Dynamic Web Pages: Client Side Processing.
Prof. James A. Landay University of Washington Spring 2008 Web Interface Design, Prototyping, and Implementation Rich Internet Applications: AJAX, Server.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
P&O3: Tools & methodologies Stefaan Ternier. Overview TCP/IP Servlets Google Web Toolkit Google Maps JPDA.
JavaScript & jQuery the missing manual Chapter 11
May 16 – 18, 2007 Copyright 2007, Data Access Worldwide May 16 – 18, 2007 Copyright 2007, Data Access Worldwide Build Great Web Application 'Fast and Easy'
Ruth Betcher Ruth Christie
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
Server-side Scripting Powering the webs favourite services.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
 2008 Pearson Education, Inc. All rights reserved Ajax-Enabled Rich Internet Applications.
Intro to Ajax Fred Stluka Jan 25, /25/2006Intro to AjaxFred Stluka2 What is Ajax? "Asynchronous JavaScript and XML" New name for an old technique:
The Document Object Model. The Web B.D, A.D. They aren’t web pages, they’re document objects A web browser interprets structured information. A server.
Google Web Toolkit An Overview By Shauvik Roy Choudhary.
Domain 3 Understanding the Adobe Dreamweaver CS5 Interface.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
GWT In-depth Explained by Rohit Ghatol
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
Overview Web Session 3 Matakuliah: Web Database Tahun: 2008.
AJAX Compiled from “AJAX Programming” [Sang Shin] (Asynchronous JavaScript and XML)
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
.  A multi layer architecture powered by Spring Framework, ExtJS, Spring Security and Hibernate.  Taken advantage of Spring’s multi layer injection.
Ajax. –Asynchronous JavaScript and XML –Umbrella term for technologies that often: Use client-side scripting for layout and formatting Use less than full.
Google Web Toolkit. What is GWT? GWT is a development toolkit for building and optimizing complex Ajax applications Goal is to enable productive development.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
the acronym for Asynchronous JavaScript and XML.
Ajax for Dynamic Web Development Gregory McChesney.
 AJAX – Asynchronous JavaScript and XML  Ajax is used to develop fast dynamic web applications  Allows web pages to be updated asynchronously by transferring.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
Kuali Days :: Chicago May 13-14, 2008 Kuali Student User Interface Overview.
Event Handling & AJAX IT210 Web Systems. Question How do we enable users to dynamically interact with a website? Answer: Use mouse and keyboard to trigger.
We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.
Dave Salinas. What is XML? XML stands for eXtensible Markup Language Markup language, like HTML HTML was designed to display data, whereas XML was designed.
AJAX Use Cases for WSRP Subbu Allamaraju BEA Systems Inc WSRP F2F Meeting, May 2006.
What is AJAX ? Asynchronous Javascript and XML. Not a stand-alone language or technology. It is a technique that combines a set of known technologies in.
Prof. James A. Landay University of Washington Spring 2008 Web Interface Design, Prototyping, and Implementation Rich Internet Applications: AJAX, Server.
AJAX – Asynchronous JavaScript And XML By Kranthi Kiran Nuthi CIS 764 Kansas State University.
 AJAX technology  Rich User Experience  Characteristics  Real live examples  JavaScript and AJAX  Web application workflow model – synchronous vs.
AJAX CS456 Fall Examples Where is AJAX used? Why do we care?
World Wide Web has been created to share the text document across the world. In static web pages the requesting user has no ability to interact with the.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
Ajax & Client-side Dynamic Web Gunwoo Park (Undergraduate)
The web, reloaded..  I. What is Web 2.0?  II. Technologies and examples of applications  III. Building Web 2.0 applications.
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
JavaScript and Ajax (Ajax Tutorial)
Google Web Toolkit Tutorial
GWT - RPC.
Google Web Toolkit - Gufran Mohammed
AJAX.
Bootstrap Components Reusable components built to provide iconography, dropdowns, input groups, navigation, alerts, and much more.
ASP.NET Module Subtitle.
Intro to Ajax Fred Stluka Jan 25, 2006.
Presentation transcript:

Ajax and the GWT

Ajax  Asynchronous JavaScript And XML  Technology behind interactive web sites  Provide smoother experience than conventional web pages  No need to refresh the entire page  Snippets of information are updated as necessary

Ajax v. non-Ajax: which is which?

Single Page Web Apps  An Ajax app typically reloads and rearranges only the parts of a page that need to change  Hence: smoother, more interactive experience  Better use of network bandwidth: no need to resend entire page each time

Ajax disadvantages  Web app state is not reflected in address bar by default – compare with non-Ajax.  Though some Ajax apps DO support this And GWT platform does  Browsers support Ajax methods in different ways: hard to get apps that work the same across all main browsers  But: good Ajax tools support this E.g. GWT

Ajax Programming The only sure thing about the acronym is JavaScript Ajax calls are not necessarily Asynchronous, though they often are ▫(asynch calls happen in background) They don’t necessarily use XML: ▫The calls can retrieve text, HTML fragments, images, JSON coded data, or XML

Ajax Client and Server  JavaScript runs in the browser And makes calls to the server for fresh content This is often done using XMLHttpRequest().  The server side is more browser-independent It’s job is to serve up dynamic data on demand

GWT: Google Web Toolkit  A toolkit to develop Ajax web application with Java.  GWT: develop entire web applications in pure Java  With a simple HTML container page to indicate basic layout  GWT compiler translates the Java code into Javascript.

Modules, Entry Points and HTML pages  A module "modulename" is described by a configuration file "modulename.gwt.xml“  An entry point in GWT is the starting point for a GWT application similar to the main method in a standard Java program  Each module can define one or more Entry points classes  The module is connected with an HTML page, which is called in GWT the host page. The code for a GWT web application executes within this HTML document.

Hello World Example  Adds some content to the HTML page  And defines what should happen when the button is clicked Pop up a window alert  The Hello example implements EntryPoint  Hence defines onModuleLoad method

HelloWorld.java (Entry Point) public class HelloWorld implements EntryPoint { public void onModuleLoad() { // define a Label to add Label label = new Label("Hello GWT !!!"); RootPanel.get().add(label); // define a Button to add Button b = new Button( "Click me", new ClickListener() { public void onClick(Widget sender) { Window.alert("Hello, AJAX"); } }); // add the Button // get is a static method of class RootPanel RootPanel.get("hi").add(b); }

HelloWorld.gwt.xml (Module Descriptor)

HelloWorld.html Hello Button should be below this. Hello there! But above this.

Server And Client (RPC)  An interfaces which extends RemoteService which lists the service methods  An implementation what implements the interface and extends RemoteServiceServlet  Define an asynchronous interface to your service which will be used in the client code

MyService.java (Interface) public interface MyService extends RemoteService { List getUserList(); MyUser getUser(String id); }

MyServiceAsync.java (Asynchronous) public interface MyServiceAsync { void getUserList(AsyncCallback > callback); void getUser(String id, AsyncCallback callback); }

MyServiceImpl.java (Service Implementation) public class MyServiceImpl extends RemoteServiceServlet implements MyService { private static final long serialVersionUID = 1L; private List userList = new ArrayList (); public MyUserServiceImpl() { //Initialize the list } public MyUser getUser(String id) { for (Object object : userList) { if (((MyUser) object).getId().equals(id)) return ((MyUser) object); } return null; } public List getUserList() { return userList; }

Web.xml … myServlet {package}.MyServiceImpl myServlet /myservice.srv …

MyCallback.java (Callback) public class MyCallback implements AsyncCallback > { private MyTable table; public MyCallback(MyTable table) { this.table = table; } public void onFailure(Throwable caught) { Window.alert(caught.getMessage()); } public void onSuccess(List result) { List users = result; DataSource datasource = new DataSource(users); table.setInput(datasource); }

See also   