Google Web Toolkit: Difference between revisions

Content deleted Content added
Linuxjava (talk | contribs)
Bender the Bot (talk | contribs)
m HTTP to HTTPS for Blogspot
 
(136 intermediate revisions by more than 100 users not shown)
Line 1:
{{Short description|Free Java library}}
{{Advert|date=October 2019}}
{{Use American English|date=December 2022}}
{{Use mdy dates|date=December 2022}}
{{Infobox software
| name = Google Web Toolkit
| logo = [[File:Gwt- logo.png|100px]]
| screenshot =
| caption =
| author = [[Google]]
| developer =
| released = May{{start 16,date and age|2006|5|16}}
| latest release version = 2.712.02
| latest release date = {{releasestart date and age|20142025|113|203}}
| latest preview version =
| latest preview date =
| programming language = [[Java (programming language)|Java]]
| operating system = [[Linux]], [[Microsoft Windows|Windows]], [[OSMacOS]], X[[FreeBSD]]
| platform =
| language = [[Java (programming language)|Java]]
| status =
| genre = [[Ajax framework]]
| license = [[Apache License]] 2.0]]
| website = {{URL|http://www.gwtproject.org/}}
}}
Line 23 ⟶ 26:
| url = http://www.gwtproject.org/GWTPolicy.html
| title = GWT Name Use Policy
| access-date = April 23, 2014
| publisher = [[Google]]
}}</ref> is an [[open-source software|open-source]] set of [[Programming tool|tools]] that allows [[web developer]]s to create and maintain [[JavaScript]] [[Front and back ends|front-end]] applications in [[Java (programming language)|Java]]. It is licensed under [[Apache License 2.0]].<ref>{{cite web
| accessdate = 2014-04-23
| url = http://www.gwtproject.org/terms.html
}}</ref> is an [[open source]] set of [[Programming tool|tools]] that allows [[web developer]]s to create and maintain complex [[JavaScript]] [[Open Back-End|front-end]] applications in [[Java (programming language)|Java]]. Other than a few native libraries, everything is Java source that can be built on any supported platform with the included GWT [[Apache Ant|Ant]] build files (Requirements for Linux Apache ant and Firefox < 27<ref>{{cite web|title=Development Mode will not be supported in Firefox 27+|url=https://groups.google.com/forum/#!topic/google-web-toolkit/QSEjbhhHB4g|website=groups.google.com}}</ref> as GWT Chrome plugin for Linux will not work<ref>{{cite web|title=GWT Developer Plugin no longer works with Chrome on Linux|url=https://groups.google.com/forum/#!topic/google-web-toolkit/Ve32_oy0kAw|website=groups.google.com}}</ref>). It is licensed under the [[Apache License]] version 2.0.<ref>{{cite web
| url = https://code.google.com/webtoolkit/terms.html
| title = Google Web Toolkit License Information
| publisher = [[Google]]
| date = February 23, 2007
| access-date = September 25, 2007
| accessdate = 2007-09-25
}}</ref>
 
GWT emphasizessupports [[reusability|reusable]] approaches to commonvarious web development tasks, namelysuch as [[remote procedure call|asynchronous remote procedure calls]], history management, [[Internet bookmark|bookmarking]], [[user interface|UI]] abstraction, [[I18N|internationalization]], and [[cross-browser]] [[porting|portability]].
 
== History ==
Line 39 ⟶ 40:
| url = https://code.google.com/webtoolkit/versions.html
| title = Google Web Toolkit Release Archive
| access-date = September 25, 2007
| publisher = [[Google]]
}}</ref> Google announced GWT at the [[JavaOne]] conference in 2006.<ref name="Steven_Olson_Ajax_Java">{{cite book
| accessdate = 2007-09-25
}}</ref> Google announced GWT at the [[JavaOne]] conference, 2006.<ref name="Steven_Olson_Ajax_Java">{{cite book
| last = Olson
| first = Steven Douglas
Line 91:
|-
| GWT 2.7.0 || November 20, 2014
|-
| GWT 2.8.0 || October 20, 2016
|-
| GWT 2.8.1 || April 24, 2017
|-
| GWT 2.8.2 || October 19, 2017
|-
| GWT 2.9.0 || May 2, 2020
|-
| GWT 2.10.0 || June 9, 2022
|-
| GWT 2.11.0 || January 9, 2024
|-
| GWT 2.12.0 || October 29, 2024
|-
| GWT 2.12.1 || November 12, 2024
|-
| GWT 2.12.2 || March 3, 2025
|}
 
In August 2010, Google acquired Instantiations,<ref>{{cite web|last=Ramsdale|first=Chris|title=Google Relaunches Instantiations Developer Tools|url=httphttps://googlewebtoolkit.blogspot.com/2010/09/google-relaunches-instantiations.html}}</ref> a company known for its focusfocusing on Eclipse Java developer tools, including GWT Designer, which is now bundled with [[Google Plugin for Eclipse]].
 
In 2011 with the introduction of the [[Dart (programming language)|Dart programming language]], Google has reassured the GWT communitystated that GWT willwould continue to be supported for the foreseeable future, butwhile also hintedhinting at a possible rapprochement between the two Google solutionsapproaches forto "structured web programming". They'veHowever, they also admitted howevermentioned that a numberseveral of the engineers previously working on GWT are now working on [[Dart (programming language)|Dart]].<ref>{{cite web|url=httphttps://googlewebtoolkit.blogspot.com/2011/11/gwt-and-dart.html |title=Google Web Toolkit Blog: GWT and Dart |publisher=Googlewebtoolkit.blogspot.com |date=2011-11-November 10, 2011 |accessdate=2013-06access-date=June 16, 2013}}</ref>
 
In 2012 at their annual I/O conference, Google announced that GWT would be transformed from a Google project to a fully open -sourced project.<ref>[https://vaadin.com/press/2012-06-29-vaadin-to-support-google-web-toolkit-gwt-development Vaadin to Support Google Web Toolkit (GWT) Development]. vaadin.com (2012-06-June 29, 2012). Retrieved on 2014-05-15.</ref> In July 2013, Google posted on its GWT blog that the transformation to an open -source project was completecompleted.<ref>[httphttps://googlewebtoolkit.blogspot.com/2013/07/gwt-news.html Google Web Toolkit Blog: GWT News]. Googlewebtoolkit.blogspot.com (2013-07-July 15, 2013). Retrieved on 2014-05-15.</ref>
 
==Development with GWT==
Using GWT, developers canhave the ability to develop and debug [[Ajax (programming)|Ajax]] applications in the Java language using the Java development tools of their choice. When the application is deployed, the GWT cross-compiler translates the Java application to standalone [[JavaScript]] files that are optionally [[Code obfuscation|obfuscated]] and deeply optimized. When needed, JavaScript can also be embedded directly into Java code, using Java comments.<ref>{{cite web|url=https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsJSNI |title=Coding Basics - JavaScript Native Interface (JSNI) - Google Web Toolkit — Google Developers |publisher=DevelopersGoogle Inc.google.com |date=2012-10-October 25, 2012 |accessdate=2013-06access-date=June 16, 2013}}</ref>
 
GWT does not revolve only around user interface programming; it is a generalbroad set of tools for building any sort of high-performance client-side JavaScript functionality. Indeed, many key architectural decisions are left completelyentirely to the developer. The GWT mission statement<ref>[https://code.google.com/webtoolkit/makinggwtbetter.html#introduction GWT mission statement]</ref> clarifies the philosophical breakdown of GWT's role versus the developer's role. History is an example of such: although GWT manages history tokens as users click Back or Forward in the browser, it does not prescribedetail how to map history tokens to an application state.
 
GWT applications can be run in two modes:
* ''Development mode'' (formerly ''Hosted mode''): The application is runruns as Java bytecode within the [[Java virtual machine|Java Virtual Machine]] (JVM).<ref>[http://www.gwtproject.org/doc/latest/DevGuideCompilingAndDebugging.html#DevGuideDevMode Debugging in Development Mode]</ref> This mode is typically used for development, supporting the [[Hot swapping#Software|hot swapping of code]] and debugging. In 2014, the classic implementation of Dev Mode was rendered unusable by browser updates<ref>{{cite mailing list|title=Development Mode will not be supported in Firefox 27+|url=https://groups.google.com/d/topic/google-web-toolkit/QSEjbhhHB4g/discussion|mailing-list=google-web-toolkit@googlegroups.com}}</ref><ref>{{cite mailing list|title=GWT Developer Plugin no longer works with Chrome on Linux|url=https://groups.google.com/d/topic/google-web-toolkit/Ve32_oy0kAw/discussion |mailing-list=google-web-toolkit@googlegroups.com}}</ref> until its replacement with the more compatible ''Super Dev Mode'', which became the default in GWT 2.7.<ref>{{cite web|url=http://www.gwtproject.org/articles/superdevmode.html |title=Super Dev Mode}}</ref>
* ''Production mode'' (formerly ''Web mode''): The application is run as pure JavaScript and HTML, compiled from the Java source. This mode is typically used for deployment.
 
Several open-source [[Plug-in (computing)|plugins]] are available for making GWT development easier with other [[integrated development environment|IDEs]], including GWT4NB<ref>[http://java.net/projects/gwt4nb/pages/Home/ GWT4NB]</ref> for [[NetBeans]], Cypal Studio for GWT<ref>[https://code.google.com/p/cypal-studio/ Cypal Studio for GWT]</ref> (an [[Eclipse (software)|Eclipse]] plugin), and GWT Developer for [[JDeveloper]]. The [[Google Plugin for Eclipse]] handles most GWT -related tasks in the IDE, including creating projects, invoking the GWT compiler, creating GWT launch configurations, validation, and [[syntax highlighting]].
 
==Components==
The major GWT components include:
;GWT Java-to-JavaScript Compiler<ref>{{cite web |url = https://github.com/gwtproject/gwt/blob/master/dev/core/src/com/google/gwt/dev/Compiler.java |title = com.google.gwt.dev.Compiler |website = [[GitHub]] |quote = The main executable entry point for the GWT Java to JavaScript compiler. }}</ref><ref>{{cite web |title = com.google.gwt.dev.jjs.JavaToJavaScriptCompiler |website = [[GitHub]] |url = https://github.com/gwtproject/gwt/blob/master/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java |quote = A base for classes that compile Java <code>JProgram</code> representations into corresponding Js source. }}</ref>
;GWT Java-to-JavaScript Compiler
:Translates the Java programming language to the JavaScript programming language.
;GWT Development Mode
:Allows the developers to run and execute GWT applications in development mode (the app runs as Java in the JVM without compiling to JavaScript). Prior to 2.0, GWT hosted mode provided a special-purpose "hosted browser" to debug your GWT code. In 2.0, the web page being debugged is viewed within a regular browser. Development mode is supported throughby the use ofusing a native-code plugin called the Google Web Toolkit Developer Plugin for many popular browsers.
;JRE emulation library
:JavaScript implementations of the commonly used classes in the Java standard class library (such as most of the java.lang package classes and a subset of the java.util package classes).
Line 122 ⟶ 140:
 
==Features==
* Dynamic and reusable [[GUI widget|UI components]]: programmers can use prebuilt-designedin classes to implement otherwise time-consuming dynamic behaviors, such as drag-and-drop or sophisticatedcomplex visual tree structures.<ref name="Bruce_Perry_GWT_Ajax">{{cite book
| last = Perry
| first = Bruce W
Line 138 ⟶ 156:
* [[JUnit|Unit testing]] integration
* Support for [[Internationalization and localization]]
* [[HTML canvas|HTML Canvas]] support (subject to API changes)<ref>{{cite web|title=GWT Javadoc Canvas|url=http://www.gwtproject.org/javadoc/latest/com/google/gwt/canvas/client/Canvas.html}}</ref>
* The developers can mix handwritten JavaScript in the Java source code using the JavaScript Native Interface (JSNI).
* Support for using Google [[Application programming interface|APIs]] in GWT applications (initially, support for [[Google Gears]]).
* Open-source
* The developers can design and develop their applicationapplications in a pure object-oriented fashion, since they're using Java (instead of JavaScript).<ref name="Bruce_Perry_GWT_Ajax"/> Common JavaScript errors, such as typos and [[Type system|type mismatches]], are caught at compile time.
* The JavaScript that the GWT compiler generates can be tailored to be either unobfuscated (Source-Mapped or Source-Code) and easier to understand or obfuscated and smaller to downloadcompressed.<ref name="Bruce_Perry_GWT_Ajax"/>
* A number of libraries are available for GWT, by Google and third parties. These extend GWTthe toolkit's features.<ref name="Bruce_Perry_GWT_Ajax"/>
 
=== Available Widgetswidgets ===
As of version 2.4 (September 2011), GWTGoogle Web Toolkit offers several [[widget (computing)|widgets]]<ref name="Widget List">{{cite web
| url = https://developers.google.com/web-toolkit/doc/latest/RefWidgetGallery
| title = Widget List
| publisher = [[Google]] Inc.
| accessdateaccess-date = 2012-05-May 21, 2012
}}</ref> and panels.<ref name="Widget List"/>
 
Line 220 ⟶ 238:
|}
 
Many common widgets not found in the GWT have been implemented in third-party libraries.
Many common widgets not found in the GWT have been implemented in third-party libraries, such as [http://www.sencha.com/products/gxt/ Sencha GXT] (formerly [http://extjs.com/products/gxt/ Ext GWT]), [http://gwt.components.googlepages.com/ GWT Component Library], [https://code.google.com/p/gwt-ext/ GWT-Ext], [http://gwt-widget.sourceforge.net/ GWT Widget Library], [http://gwtiger.org/ GWTiger], [https://code.google.com/p/rocket-gwt/ Rocket GWT], [https://code.google.com/p/tatami/ Dojo], [https://code.google.com/p/smartgwt/ SmartGWT] etc.
 
==Enterprise Usageusage==
GWT uses or supports [[Java (programming language)|Java]], [[Apache Tomcat]] (or similar web container), [[Eclipse IDE]], [[Internet Explorer]],<ref>[http://www.gwtproject.org/doc/latest/DevGuideIE9.html GWT Project]. GWT Project. Retrieved on 2014-05-May 15, 2014.</ref> and [[Internationalizationinternationalization and localization|Internationalization and Localization]]. Java-based GWT [[Richrich Internetweb Application|RIAapplications]]s can be tested using [[JUnit]] testing framework and code coverage tools. Because GWT allows compile time verification of images, CSS, and business logic, many common development defects are automatically discovered without need ofrequiring the manual testing commonly required by RIAs.
 
Google has noted that some of its products are [http://gwtreferencelist.appspot.com/#AboutPlace: GWT -based]:<ref>{{cite web
| url = httphttps://www.youtube.com/watch?feature=player_detailpage&v=VOf27ez_Hvg#t=450s
| title = Google I/O 2012 - The History and Future of Google Web Toolkit
| date = July 10, 2012
| publisher = GoogleDevelopers
| accessdateaccess-date = 2013-03-March 18, 2013
}}</ref> [[Blogger (service)|Blogger]], [[Google Ads|AdWords]], [[Google Flights|Flights]], [[Google Wallet|Wallet]], [[Google Offers|Offers]], [[Usenet newsgroup|Groups]], [[Google Inbox|Inbox]].<ref>{{cite web |last1=Toubassi |first1=Garrick |title=Going under the hood of Inbox|url=https://gmailblog.blogspot.com/2014/11/going-under-hood-of-inbox.html |website=Official Gmail Blog|access-date=November 22, 2014}}</ref>
}}</ref>
* [[Blogger (service)|Blogger]]
* [[AdWords]]
* [[Google Flights|Flights]]
* [[Google Wallet|Wallet]]
* [[Google Offers|Offers]]
* [[Usenet newsgroup|Groups]]
* [[Google Inbox|Inbox]]<ref>{{cite web|last1=Toubassi|first1=Garrick|title=Going under the hood of Inbox|url=http://gmailblog.blogspot.com/2014/11/going-under-hood-of-inbox.html|website=Official Gmail Blog|accessdate=22 November 2014}}</ref>
 
Other companies using GWT are listed on the [http://gwtreferencelist.appspot.com/ GWT Reference List] and [http://www.gwtproject.org/examples.html#real-world-projects real world projects examples].
 
==GWT 2.0==
On DecDecember 088, 2009, Google launched Google Web Toolkit 2.0 with Speed Tracer.<ref>[httphttps://googlewebtoolkit.blogspot.com/2009/12/introducing-google-web-toolkit-20-now.html Introducing Google Web Toolkit 2.0, now with Speed Tracer]</ref>
 
Version 2.0 of GWT offers a number of new features,<ref>{{cite web
| url = httphttps://groups.google.com/group/google-web-toolkit/browse_thread/thread/8b79ebe444b9126d
| title = GWT 2.0 milestone 1 announcement
| publisher = Amit Manjhi
| accessdateaccess-date = October 5, 2009-10-05
}}</ref> including:
* In-Browser Development Mode (formerly known as Out Of Process Hosted Mode, OOPHM): prior to version 2.0, the hosted mode was used to embed a modified browser to allow running the bytecode version of the application during development. With version 2.0, hosted mode, renamed "development mode", allows using any (supported) browser to view the page being debugged, through the use of a browser plugin. The plugin communicates with the development mode shell using TCP/IP, which allows cross -platform debugging (for example, debugging in Internet Explorer on Windows from a development mode shell running on a Linux machine).
* Code splitting: with the developer providing "split points" in the source code, the GWT compiler will be able tocan split the JavaScript code into several small chunks instead of one big download. This will lead to reduced application startup time as the size of the initial download is decreased.
* Declarative User Interface: using an XML format, the new feature known as UiBinder allows the creation of user interfaces through declaration rather than code. This allows a clean separation of UI construction and behavior implementation.
* Resource bundling: the ClientBundle interface will allow resources of any nature (images, CSS, text, binary) to be bundled together and transferred in one download, resulting in fewer round-trips to the server and hence lower application latency.
 
Since the new development mode removed most platform-specific code, the new version will be distributed as a unique archive, instead of one per supported platform, as was the case with previous versions.
 
==Mobile==
As a general framework for making web apps, GWTGoogle Web Toolkit is also capable of being used as a framework for makingcreating mobile and tablet apps, either by making the needed widgets and animations from scratch, or by using one of the mobile frameworks for GWT. An HTML5 app written in GWT can have separate views for Tablets and Mobile phones.
 
Some of the most common mobile GWT libraries
*[https://code.google.com/p/gwtmobile/ GwtMobile]
*[https://code.google.com/p/gwt-mobile-webkit/ gwt-mobile-webkit]
*[https://github.com/sksamuel/jqm4gwt jqm4gwt]
*[http://m-gwt.com/ m-gwt]
*[https://github.com/gwtbootstrap3 gwtbootstrap3]
 
==See also==
{{Portal|Free and open-source software|Computer programming}}
* [[Dart (programming language)]]
* [[Google Plugin for Eclipse]]
* [http://gwt.google.com/samples/Showcase/Showcase.html Showcase/Live Demo of GWT Features]
* [[Google Code]]
* [[Comparison of JavaScript-based web frameworks]]
* [[Comparison of server-side web applicationframeworks|Comparison of web frameworks]]
* [[Emscripten]] for converting [[C++]] into JavaScript or [[WebAssembly]]
 
* [[RAS syndrome]]
===Other frameworks===
* GWT-Platform [https://github.com/ArcBees/GWTP GWTP], an annotation based Model-View-Presenter framework for GWT built by [http://www.arcbees.com Arcbees]
* [http://www.jboss.org/errai Errai] is a GWT-based framework for building rich web applications using next-generation web technologies. Built on-top of ErraiBus, the framework provides a unified federation and RPC infrastructure with true, uniform, asynchronous messaging across the client and server.
* [https://code.google.com/p/smartgwt/ SmartGWT], a GWT framework with a comprehensive widget library and server side databinding capabilities
* [[Vaadin]], uses GWT as a "rendering engine" on the browser side of its server-based web apps written in Java.<ref>{{cite web| url = https://vaadin.com/faq | title = Vaadin FAQ | accessdate = 2014-05-11 | publisher= Vaadin Ltd. }}</ref>
* [http://www.sencha.com/products/gxt/ Sencha GXT], GWT port of the popular [[Ext JS]] UI Framework commonly used in Enterprise applications.
* [http://www.cruxframework.org/?locale=en_US#!view=home Crux Framework] is an open source GWT-based component framework for fast development of web and mobile applications.
* [[Pyjamas (software)|Pyjamas]] Pyjamas, a port of GWT to Python
* [[RubyJS]], a port of GWT to Ruby
* [[ZK (framework)|ZK]], a similar framework, which is also written in Java.
* [http://www.gwtphp.com/ GwtPHP], Backend for GWT in PHP.
* [http://scalagwt.github.com/ Scala+GWT], compile Scala code for the browser via the GWT toolchain.
* [[JavaCC]], GWT compatible <ref>{{cite web| url = http://consoliii.blogspot.co.uk/2014/04/creating-gwt-compatible-parser-using.html | title = Building parsers for the web with JavaCC & GWT (Part one) | accessdate = 2014-05-04 | publisher=Chris Ainsley}}</ref> parser generator, implement client-side (JavaScript-based) parsers in Java.
 
==References==
{{reflistReflist|33em}}
 
==Bibliography==
Line 300 ⟶ 290:
| publisher = [[Prentice Hall]]
| date = December 15, 2007
| page = 608
| url = http://www.informit.com/store/product.aspx?isbn=0321501969
| isbn = 978-0-321-50196-7
Line 310 ⟶ 300:
| publisher = [[Packt Publishing]]
| date = February 15, 2007
| page = 248
| url = http://www.packtpub.com/google-web-toolkit-GWT-Java-AJAX/book
| isbn = 978-1-84719-100-7
Line 320 ⟶ 310:
| publisher = [[Prentice Hall]]
| date = November 17, 2007
| page = 408
| url = http://www.informit.com/store/product.aspx?isbn=0132344815
| isbn = 978-0-13-234481-4
Line 330 ⟶ 320:
| title = GWT in Action
| edition = 2nd
| publisher = [[Manning Publications|Manning]]
| date = February 7, 2013
| urlpage = 643
| page = 643
| isbn = 978-1-935182-84-9
}}
Line 339 ⟶ 328:
| last = Cooper
| first = Robert
| author2 = Charlie Collins
| title = GWT in Practice
| publisher = [[Manning Publications|Manning]]
| date = May 12, 2008
| url = https://archive.org/details/gwtinpractice00robe_0/page/376
| url =
| page = [https://archive.org/details/gwtinpractice00robe_0/page/376 376]
| page = 376
| isbn = 978-1-933988-29-0
| url-access = registration
}}
}}
 
==External links==
* [https://code.google.com/webtoolkit/ GWT homepage on Google code]
* [http://googlewebtoolkit.blogspot.com/ Official GWT blog]
* [http://groups.google.com/group/Google-Web-Toolkit Official GWT forums]
* [https://code.google.com/p/google-web-toolkit-incubator/ Google Web Toolkit Incubator]
* [http://www.VoicesThatMatter.com/GWT2007 Conference on GWT organized by Addison-Wesley, Prentice Hall and Pearson Education]
 
{{Application frameworks}}
{{JavaScript|state=collapsed}}
{{Java (Sun)}}
{{ECMAScript}}
{{Google Inc.LLC}}
{{Widget toolkits}}
{{Rich Internetweb applications}}
{{Authority control}}
 
[[Category:Google software|Web Toolkit]]
[[Category:Java platform]]
[[Category:JavaScript libraries]]
[[Category:Rich web application frameworks]]
[[Category:Software using the Apache license]]
[[Category:Web development software]]
[[Category:Rich Internet application frameworks]]
[[Category:Java platform]]
[[Category:Software using the Apache license]]