Google Web Toolkit. Peter Norrhall



Similar documents
Google Web Toolkit. Introduction to GWT Development. Ilkka Rinne & Sampo Savolainen / Spatineo Oy

Fast, Easy, Beautiful: Pick Three Building User Interfaces with Google Web Toolkit. Chris Schalk October 24, 2007

Google Web Toolkit. Progetto di Applicazioni Software a.a. 2011/12. Massimo Mecella

Google Web Toolkit (GWT) Architectural Impact on Enterprise Web Application

The Google Web Toolkit (GWT): Declarative Layout with UiBinder Basics

WA 2. GWT Martin Klíma

place/business fetch details, removefromfavorite () function, 189 search button handler bind, B BlackBerry build environment

Google Web Toolkit GWT

HTML Form Widgets. Review: HTML Forms. Review: CGI Programs

The Google Web Toolkit (GWT): The Model-View-Presenter (MVP) Architecture Official MVP Framework

The Dark Side of Ajax. Jacob West Fortify Software

Preface. Motivation for this Book

Enterprise Application Development In Java with AJAX and ORM

Application layer Web 2.0

DIPLOMA IN WEBDEVELOPMENT

Rich Internet Applications

The Google Web Toolkit (GWT): Overview & Getting Started

What s New in IBM Web Experience Factory IBM Corporation

Software Development Interactief Centrum voor gerichte Training en Studie Edisonweg 14c, 1821 BN Alkmaar T:

ArcGIS Server mashups

Credits: Some of the slides are based on material adapted from

Client-side Web Engineering From HTML to AJAX

Mobile development with Apache OFBiz. Ean Schuessler, Brainfood

A Web-Based Environment for Learning Normalization of Relational Database Schemata

Integration the Web 2.0 way. Florian Daniel April 28, 2009

Rich-Internet Anwendungen auf Basis von ColdFusion und Ajax

WINDOWS PRESENTATION FOUNDATION LEKTION 3

Progressive Enhancement With GQuery and GWT. Ray Cromwell

Developing Web Views for VMware vcenter Orchestrator

Data Visualization in Ext Js 3.4

Some Issues on Ajax Invocation

Rich Web Applications in Server-side Java without Plug-ins or JavaScript

GUI and Web Programming

Selenium Automation set up with TestNG and Eclipse- A Beginners Guide

An introduction to creating Web 2.0 applications in Rational Application Developer Version 8.0

Budget Event Management Design Document

Appium mobile test automation

Development Techniques for Native/Hybrid Tizen Apps. Presented by Kirill Kruchinkin

Petroleum Web Applications to Support your Business. David Jacob & Vanessa Ramirez Esri Natural Resources Team

AJAX and JSON Lessons Learned. Jim Riecken, Senior Software Engineer, Blackboard Inc.

Implementing Mobile Thin client Architecture For Enterprise Application

ANDROID APP DEVELOPMENT: AN INTRODUCTION CSCI /19/14 HANNAH MILLER

Exploiting Web 2.0 Next Generation Vulnerabilities

IBM Digital Experience. Using Modern Web Development Tools and Technology with IBM Digital Experience

Rapid Application Development. and Application Generation Tools. Walter Knesel

Selenium WebDriver. Gianluca Carbone. Selenium WebDriver 1

Blackbox Reversing of XSS Filters

How To Write A Web Server In Javascript

Load Testing RIA using WebLOAD. Amir Shoval, VP Product Management

Example. Represent this as XML

How To Write An Ria Application

Security features of ZK Framework

Overview. In the beginning. Issues with Client Side Scripting What is JavaScript? Syntax and the Document Object Model Moving forward with JavaScript

Load Testing Ajax Apps using head-less browser tools. NoVaTAIG April 13, 2011 Gopal Addada and Frank Hurley Cigital Inc.

Security Research Advisory IBM inotes 9 Active Content Filtering Bypass

Cross Platform App Development

Web-Application Security

Learning HTML5 Game Programming

AJAX. Gregorio López López Juan Francisco López Panea

OWASP and OWASP Top 10 (2007 Update) OWASP. The OWASP Foundation. Dave Wichers. The OWASP Foundation. OWASP Conferences Chair

Course Number: IAC-SOFT-WDAD Web Design and Application Development

DESIGNING MOBILE FRIENDLY S

AJAX Toolkit Framework

Develop a Native App (ios and Android) for a Drupal Website without Learning Objective-C or Java. Drupaldelphia 2014 By Joe Roberts

Introduction to BlackBerry Smartphone Web Development Widgets

Developing Cross-platform Mobile and Web Apps

Traitware Authentication Service Integration Document

Take full advantage of IBM s IDEs for end- to- end mobile development

Jordan Jozwiak November 13, 2011

AJAX and jmaki for Web 2.0 Development using Java. Inyoung Cho Java Technology Evangelist Sun Microsystems, Inc.

Google App Engine f r o r J av a a v a (G ( AE A / E J / )

Bug Report. Date: March 19, 2011 Reporter: Chris Jarabek

Next Generation Clickjacking

How To Develop A Mobile App With Phonegap

Eclipse Web Tools Platform. Naci Dai (Eteration), WTP JST Lead

DreamFactory & Modus Create Case Study

QML and JavaScript for Native App Development

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

J j enterpririse. Oracle Application Express 3. Develop Native Oracle database-centric web applications quickly and easily with Oracle APEX

Component Based Web Development with Apache Wicket

IBM Script Portlet for WebSphere Portal Release 1.1

Android Developer Fundamental 1

Mobile Application Development

ISL Online Integration Manual

Performance Testing Web 2.0. Stuart Moncrieff (Load Testing Guru) /

Experimental Comparison of Hybrid and Native Applications for Mobile Systems

TDAQ Analytics Dashboard

Automation using Selenium

Ready, Set, Go Getting started with Tuscany

Tutorial: Building a Dojo Application using IBM Rational Application Developer Loan Payment Calculator

Microsoft + SOA = Sant? Joakim Linghall Principal System Engineer SOA and Business Process joakiml@microsoft.com

Whitepaper. Rich Internet Applications. Frameworks Evaluation. Document reference: TSL-SES-WP0001 Januar

Transcription:

Google Web Toolkit Peter Norrhall

Ajax och JavaScript

Frågor!

Papyrus - Pappersgrossist - B2B E-handel - 19 Länder/Språk - drygt 1 miljard i omsättning - Revival-projekt

Bakgrund o Historik Pre-Ajax Ajax

HTML vs Ajax HTML Stateless HTML View Browser User Action New HTML page Stateful Server Ajax Events handled locally Stateful JavaScript UI Browser Remote procedure call Data only, not HTML Stateless Server

Ajax + Upplevelse + Funktionalitet/Användbarhet + Hastighet + Ingen installation - Säkerhet - Tillgänglighet (accessibility) - JavaScript - Bakåtknappen/Historik - Webbläsarinkompabilitet

GWT - Java till JavaScript

GWT Demo (Eclipse, Hosted Mode, Debug)

GWT - Arkitektur JSNI Java till JS Kompilator JRE Emulering GWT API Widget & Panels i18n RPC XML Parser Historik JUnit integration

2.0 Webbläsare 6, 7 1.0, 1.5, 2.0 8.5, 9.0

Java-till-JavaScript Kompilator BookSearch.html BookSearch.css history.html BookSearch.html BookSearch.css history.html XXXXXXXXXXXX.cache.xml...client.BookSearch.java EntryPoint Standard App BookSearch.nocache.js XXXXXXXXXX.cache.html booksearch.gwt.xml Cross Site App <set-property name= user.agent value= ie6 /> <extend-property name="locale" values="se"/> BookSearch.nocache-xs.js XXXXXXXXXX.cache.js

Java-till-JavaScript Kompilator GWT:s mål: Att generera lika bra eller bättre JavaScript än vad en utvecklare kan åstadkomma Analyserar källkoden Tar bort död kod Optimerar koden Komprimerar koden Hanterar webläsarnas olikheter

Widgets, Panels & Historik Demo (KitchenSink)

Skapa egna Widgets

Widget - Arv ButtonBase CheckBox RadioButton

RadioButton public class RadioButton extends CheckBox { public RadioButton(String name) { super(dom.createinputradio(name)); setstylename("gwt-radiobutton"); }... }

EditLabel - Composite Composite EditLabel Label TextBox Label

KompositWidget public class EditLabel extends Composite { public EditLabel() { final HorizontalPanel horizontalpanel = new HorizontalPanel(); initwidget(horizontalpanel); final Label label = new Label("Label"); horizontalpanel.add(label); final TextBox textbox = new TextBox(); horizontalpanel.add(textbox); } }

DOM Widget UIObject Widget FileUpload

FileUpload DOM public class FileUpload extends Widget implements HasName { } public FileUpload(String name){ super(dom.createelement("input")); DOM.setAttribute(getElement(), "type", "file"); setstylename("gwt-fileupload"); } public String getfilename() { return DOM.getElementProperty(getElement(), "value"); } public String getname() { return DOM.getElementProperty(getElement(), "name"); } public void setname(string name) { DOM.setElementProperty(getElement(), "name", name); }

Paneler

Layout, Widgets och CSS.gwt-TextBox { height: 8px } mobile.css <div id= search > </div SearchFrm.html.gwt-TextBox { height: 14px } screen.css RootPanel.get( search ).add(textbox); SearchFrm.java

GWT-RPC Integration XHR Remote procedure call RequestBuilder Data only, not HTML

Mash-Ups www.mysite.com (Proxy)

GWT-RPC Serializable SearchResult.java String name; String isbn;

GWT-RPC - AmazonSearch Klient AmazonSearch.java onclick() {... } onsuccess() {...} AmazonSearchService.java public List searchbook Server RemoteServiceServlet AmazonSearchServiceImpl.java public List searchbook() {...} SearchResult.java String name; String isbn; GWT 1.5 public List<SearchResult> searchbook() Serializable

Demo Demo (AmazonSearch)

RequestBuilder

JSON object peter = { name : Peter, age :40, married :true, mistress :null} array norrhalls = [peter, maria, frida, linnea, jakob, moa]

Yahoo - XML http://search.yahooapis.com/websearchservice/v1/websearch?appid=movlin&outp ut=xml&results=5&query=gwt <ResultSet xsi:schemalocation="urn:yahoo:srch http://api.search.yahoo.com/websearchservice/v1/websearchresponse.xsd" type="web" totalresultsavailable="4930000" totalresultsreturned="5" firstresultposition="1" moresearch="/websearchservice/v1/websearch?query=gwt&appid=gwt-book&region=us"> <Result> <Title>Google Web Toolkit - Google Code</Title> <Summary> Java software development framework that makes writing AJAX applications like Google Maps and Gmail easy for developers... Download Google Web Toolkit (GWT)... </Summary> <Url>http://code.google.com/webtoolkit/</Url> <ClickUrl> http://uk.wrs.yahoo.com/_ylt=a9htfsgdi5lhmaebpihdmmwf;_ylu=x3odmtb2b2gzdddtbgnvbg8dzqrsa1dtmqrwb3mdmqrzzw MDc3IEdnRpZAM-/SIG=11madreo9/EXP=1201304861/**http%3A//code.google.com/webtoolkit/ </ClickUrl>...

Yahoo - JSON http://search.yahooapis.com/websearchservice/v1/websearch?appid=movlin&outp ut=json&results=5&query=gwt {"ResultSet":{"type":"web","totalResultsAvailable":4930000,"totalResultsRet urned":5,"firstresultposition":1,"moresearch":"\/websearchservice\/v1\/w ebsearch?query=gwt&appid=gwt- Book&region=us","Result":[{"Title":"Google Web Toolkit - Google Code","Summary":"Java software development framework that makes writing AJAX applications like Google Maps and Gmail easy for developers... Download Google Web Toolkit (GWT)...","Url":"http:\/\/code.google.com\/webtoolkit\/","ClickUrl":"http:\/\ /uk.wrs.yahoo.com\/_ylt=a9iby4wpjjlhlcqbfgbdmmwf;_ylu=x3odmtb2b2gzdddtbg NvbG8DZQRsA1dTMQRwb3MDMQRzZWMDc3IEdnRpZAM- \/SIG=11mt0u0om\/EXP=1201304975\/**http%3A\/\/code.google.com\/webtoolki t...

RequestBuilder EntryPoint Klient RequestCallback Server HttpServlet JSONSearch.java onclick() {... } onresponsereceived () {...} JSONSearchService.java protected void dopost () {...}

RequestBuilder cd RequestBuilder «interface» EntryPoint + onmoduleload() : void «interface» RequestCallback + onerror(throwable, Request) : void + onresponsereceived(response, Request) : void HttpServlet + dopost(httpservletresponse, HttpServletRequest) : void JSONSearch JSONSearchServ ice + onerror(throwable, Request) : void + onmoduleload() : void + onresponsereceived(response, Request) : void - search() : void + dopost(httpservletresponse, HttpServletRequest) : void +requestbuilder 1 RequestBuilder + sendrequest(requestcallback, String) : void

RequestBuilder JSONObject o = new JSONObject(); o.put("searchstring", new JSONString(searchString)); o.put("maxresults", new JSONNumber(5)); RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, GWT.getModuleBaseURL() + "search"); try { rb.sendrequest(o.tostring(), new SearchResultsHandler()); } catch (RequestException e) { GWT.log("Could not send search request", e); }

Demo

Integration forts GWT-REST (GWT-ON-RAILS) - gwt-sl eller annoteringar - hibernate4gwt (inklusive Spring) Dwr4gwt server push

i18n cd i18n «interface» Constants SearchAppConstans.properties buttontext=search «interface» SearchAppConstants SearchAppConstans_sv.properties buttontext=sök - buttontext: String + «property get» getbuttontext() : String + «property set» setbuttontext(string) : void private static final SearchAppConstants CONSTANTS = (SearchAppConstants) GWT.create(SearchAppConstants.class); clickmebutton.settext(constants.getbuttontext());

i18n Demo (Îñţérñåţîöñåļîžåţîöñ Sample)

JavaScript Native Interface Att komma åt browserfunktionalitet Att komma åt andra JavaScript bibliotekt Att låta legacy JavaScript komma åt min kod public native static java_class method() /*- {... } -*/ Effects.java JavaScript Kod

JSNI <div class="example" id="demo-effect-pulsate" onclick="new Effect.Pulsate(this)"> <img src="http://script.aculo.us/images/demo-logo.gif" alt="" /> <span>click me</span> </div> Java applyeffect("pulsate", clickbutton.getelement()); private native void applyeffect( String name, Element element ) /*-{ $wnd.effect[name](element); }-*/; JavaScript function $applyeffect(this$static, name, element){ $wnd.effect[name](element); }

JSNI Demo - Effect (script.actulo.us)

Papyrus - Leveransplan

Papyrus - Leveransplan

Papyrus - Leveransplan Click

JSNI + = gwtext

JSNI Demo - Leveransplan (ExtJs)

Prototyp Demo - Sökning

Prestanda (Källa Google)

Bilder Kodstorlek Prestanda (GWT 1.4) <30% Prestanda <20-50% Läsbarhet (pretty,detailed, obfuscated) Cachning

Prestanda 1.0 -> 1.4

Säkerhet

Säkerhet 80 % beror på dålig kontroll av extern data

Säkerhet XSS - Cross-Site Scripting CSRF Cross-Site Request Forging JavaScript Hijacking Ajax Security Hoffman, Billy

GWT - Säkerhet Compile-time check Tar bort kommentarer Obfuscated Samma domänobjekt på klient och server

GWT Infrastruktur code.google.com/webtoolkit Verktyg Böcker Konferens En massa gwt-xxx projekt (med status 0.x.y)

GWT-svagheter Google Native GWT Komponenter Säkerhet DataTransferObject

Fördelar GWT Ej expert på JavaScript Verktygstöd Användbarhet och prestanda i fokus Google + Apache 2.0 Open Source Minnesläckor Test/Refaktorering Hanterar Historik och bokmärken

Avslutande Frågor

GWT - Mission To radically improve the web experience for users by enabling developers to use existing Java tools to build no-compromise AJAX for any modern browser 8.5, 9.0 2.0 6, 7 1.0, 1.5, 2.0

Referenser http://code.google.com/webtoolkit http://www.instantiations.com/gwtdesigner http://www.json.org http://www.manning.com/hanson/