GWT V2.2 publishes Ajax front-end using the Java programming language

Source: Internet
Author: User
Keywords Java can write compile
Tags ajax aliyun applications browser browsers code compile compiler

The acronym for Google WEB Toolkit, with GWT being able to write AJAX front-end using the Java programming language, and then GWT will cross compile to the optimized http://www.aliyun.com/zixun/aggregation/33906.html ">javascript, while JavaScript can be run automatically on all major browsers. GWT allows developers to quickly build and maintain complex but high performance JavaScript front-end applications using the Java programming language, reducing development difficulties, especially when used in conjunction with the Eclipse Google plug-in.

Writing a Web application today is a tedious and error-prone process. Developers may spend 90% of their time dealing with browser jargon. In addition, building, reusing, and maintaining a large number of JavaScript code libraries and AJAX components can be difficult and unreliable. Google Web Toolkit (GWT) allows developers to quickly build and maintain complex and high-performance JavaScript front-end applications using the Java programming language, reducing development difficulties, especially when used in conjunction with the Eclipse Google plug-in.

How Google Web Toolkit works

With Google Web Toolkit (GWT), you can use the Java programming language to write AJAX front-end, and GWT will cross-compile into optimized JavaScript, and JavaScript can be run automatically on all major browsers. In the development process, you can use JavaScript in accordance with your customary "edit-refresh-View" This constant cycle of rapid repetition, this also has the advantage of being able to debug line-by-row and step into your Java code. When you are ready to deploy, GWT compiles the Java source code into an optimized, stand-alone JavaScript file. Using Google Web Toolkit makes it easy to build a Widget for an existing Web page or for an entire application.

Writing AJAX applications in the Java language and compiling them into optimized JavaScript

Unlike JavaScript Minifier, which runs only at the text level, the GWT compiler performs comprehensive static analysis and optimization throughout the GWT code base, and typically generates JavaScript loads and executes faster than equivalent handwritten javascript. For example, the GWT compiler can safely eliminate unwanted code-dramatically reducing unused classes, methods, fields, and even method parameters-to ensure that the scripts you compile are as minimal as possible. Another example: The GWT compiler selectively inline the method, eliminating the performance overhead of the method invocation.

Cross-compilation provides the maintainable extraction and modularity required for development without causing run-time performance loss.

Development Workflow:

Edit Java code and view changes immediately without recompiling

During development, you can view code changes immediately using GWT's managed-mode browser. No assembler translation is required or deployed to the server. Just make the changes, and then click Refresh in the managed mode browser.

To step through the current AJAX code with the Java debugger

During the production process, code can be compiled into pure JavaScript, but in the development phase, the code will run as a bytecode in the Java virtual machine. This means that when the code performs operations such as handling mouse events, it will get a fully functional normal Java debugging. Any action that the Java debugger can perform also applies to your GWT code, so you can naturally perform such operations as breakpoints and Single-step debugging.

Compiling and deploying optimized, Cross-browser JavaScript

When you are ready to deploy, GWT compiles the Java code into a standalone, pure JavaScript file that is supported by any network server. In addition, GWT applications automatically support IE, Firefox, Mozilla, Safari, and Opera without the need for browser detection or special encapsulation in your code. After writing the same code, GWT converts it to the most efficient JavaScript based on each user's special browser.

Download Address: http://code.google.com/intl/zh-CN/webtoolkit/download.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.