`
oceanG_Y
  • 浏览: 51447 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

GWT学习笔记(一)

    博客分类:
  • Java
阅读更多

Language Support

      Intrinsic types:   byte, char, short, int, long, float, double, Object, String, and arrays are supported. However, there is no 64-bit integral type in JavaScript, so variables of type long are mapped onto JavaScript double-precision floating point values. To ensure maximum consistency between hosted mode and web mode, we recommend that you use int variables.

       Exceptions:try, catch, finally and user-defined exceptions are supported as normal, although Throwable.getStackTrace() is not supported for web mode. See Throwable for additional details.

     Assertions:The GWT compiler parses Java assert statements, but it does not emit code JavaScript code for them.

      Multithreading and Synchronization:JavaScript interpreters are single-threaded, so while GWT silently accepts the synchronized keyword, it has no real effect. Synchronization-related library methods are not available, including Object.wait(), Object.notify(), and Object.notifyAll()

        Reflection:For maximum efficiency, GWT compiles your Java source into a monolithic script, and does not support subsequent dynamic loading of classes. This and other optimizations preclude general support for reflection. It is possible to query an object for its class name using GWT.getTypeName(Object). 

       Finalization:JavaScript does not support object finalization during garbage collection, so GWT isn't able to be honor Java finalizers in web mode.

     Strict Floating-Point:The Java language specification precisely defines floating-point support, including single-precision and double-precision numbers as well as the strictfp keyword. GWT does not support the strictfp keyword and can't ensure any particular degree of floating-point precision in translated code, so you may want to avoid calculations in client-side code that require a guaranteed level of floating-point precision.

Runtime Library Support

Some specific areas in which GWT emulation differs from the standard Java runtime:

  • Regular Expressions:The syntax of Java regular expressions is similar, but not identical, to JavaScript regular expressions. For example, the replaceAll and split methods use regular expressions. So, you'll probably want to be careful to only use Java regular expressions that have the same meaning in JavaScript.
  • Serialization:Java serialization relies on a few mechanisms that are not available in compiled JavaScript, such as dynamic class loading and reflection. As a result, GWT does not support standard Java serialization. Instead, GWT has an RPC facility that provides automatic object serialization to and from the server for the purpose of invoking remote methods.

      Tip:  You'll save yourself a lot of frustration if you make sure that you use only translatable classes in your client-side code from the very beginning. To help you identify problems early, your code is checked against the JRE emulation library whenever you run in hosted mode. As a result, most uses of unsupported libraries will be caught the first time you attempt to run your application. So, run early and often.

 

Cross-browser Support

Whenever possible, GWT defers to browsers' native user interface elements. For example, GWT's Button widget is a true HTML <button> rather than a synthetic button-like widget built, say, from a <div>. That means that GWT buttons render appropriately in different browsers and on different client operating systems. We like the native browser controls because they're fast, accessible, and most familiar to users.

分享到:
评论

相关推荐

    gwt学习笔记汇总

    这个“gwt学习笔记汇总”包含了从基础知识到实际应用的全面学习材料,对于初学者来说是一份非常宝贵的资源。 GWT的核心概念是Java-to-JavaScript编译器,它允许开发者用Java语言编写客户端代码,然后编译成优化过的...

    smartGwt学习笔记

    在SmartGWT的学习和开发过程中,经常会遇到各种挑战和问题,比如本文提到的“分页问题GridPager”。SmartGwt是一个强大的Java库,用于构建基于Web的用户界面,它提供了丰富的组件,包括ListGrid,一个功能强大的表格...

    GWT学习笔记,个人学习心得

    Google Web Toolkit (GWT) 是一种基于Java的开源开发框架,它允许开发者使用Java语言来构建富互联网应用程序(RIA),特别是利用Ajax技术。GWT的主要目标是简化开发流程,使得开发人员可以专注于业务逻辑,而不必...

    Gwt-ext学习笔记

    这篇学习笔记将深入探讨Gwt-ext的核心概念、功能以及如何在实际项目中应用。 GWT是由Google开发的一个开源框架,它允许开发者使用Java语言来编写前端Web应用。GWT编译器会将Java代码转换为优化过的JavaScript,以...

    GWT的入门实例和学习笔记

    这个压缩包文件包含两个重要的资源:一个“gwt的HelloWorld实例.doc”和“GWT学习笔记.doc”,它们是针对GWT初学者的理想入门资料。 “gwt的HelloWorld实例.doc”很可能是对GWT基本用法的直观展示。在GWT中,Hello...

    gwt学习笔记

    ### GWT 学习笔记 #### 一、GWT 基础介绍 GWT(Google Web Toolkit)是由Google开发的一套用于构建高度交互式的Web应用程序的开发框架。它允许开发者使用Java语言来编写前端代码,并将其编译为浏览器可执行的...

    Gwt-ext学习笔记之基础篇

    ### Gwt-ext学习笔记之基础篇 #### 一、安装CypalStudio工具 为了能够开始Gwt-ext的学习之旅,首先需要确保开发环境已经搭建好。CypalStudio是一款非常实用的工具,它能帮助开发者更高效地进行GWT项目的开发。 1....

    Gwt-Ext学习笔记之进级篇

    GWT是一个开源的开发工具,允许开发者使用Java语言来编写客户端的Web应用程序,然后将其编译为优化过的JavaScript代码,以实现高性能的富互联网应用(RIA)。而Ext Js是一个JavaScript库,提供了丰富的用户界面组件...

    GWT学习笔记

    GWT,全称为Google Web Toolkit,是Google推出的一款用于构建高效、跨平台的Web2.0应用程序的开源...学习GWT可以帮助开发者利用熟悉的Java语法进行前端开发,提高开发效率,同时利用AJAX技术实现丰富的用户交互体验。

    (转载)GWT -EXT学习笔记-基础

    ### GWT-EXT基础知识详解 #### 一、GWT与GWT-EXT简介 Google Web Toolkit (GWT) 是一款由Google开发的开源...这为后续深入学习GWT-EXT提供了坚实的基础。接下来,可以根据实际需求进一步探索更多高级特性和技术细节。

    Gwt-Ext学习笔记之基础篇- www.hxiaseo.cn技术网站

    标题中的"Gwt-Ext学习笔记之基础篇"指的是关于Gwt-Ext的初级教程,这是一种基于Google Web Toolkit (GWT) 的扩展库,用于构建富互联网应用程序(RIA)。Gwt-Ext提供了丰富的用户界面组件,使得开发者可以利用Java语言...

    GWT EXT 教程全集

    " Gwt-Ext学习笔记之基础篇.doc "、" Gwt-Ext学习笔记之中级篇.doc "、" Gwt-Ext学习笔记之进级篇.doc "这三份文档,按照从基础到进阶的顺序,系统地介绍了EXT-GWT的使用技巧和实践案例。基础篇可能涵盖EXT-GWT的...

    面向 Java 开发人员的 Ajax: Google Web Toolkit 入门(GWT入门)

    Google Web Toolkit (GWT) 是一个强大的工具,它允许Java开发人员使用熟悉的Java语言来构建高性能、跨浏览器的Ajax应用程序。GWT通过将Java代码编译为优化过的JavaScript,解决了Web开发中的语言障碍,使得开发人员...

    SpringMVC学习笔记

    **SpringMVC学习笔记** SpringMVC是Spring框架的一个模块,专为构建Web应用程序而设计。它是一个基于模型-视图-控制器(MVC)架构的轻量级Java Web开发框架,提供了处理HTTP请求、数据绑定、验证以及与后端服务交互...

    DWR学习笔记(下载)

    - **GWT(Google Web Toolkit)**:GWT也是基于Java的,但编译时将Java代码转换为JavaScript,而DWR则是运行时动态生成JavaScript。 ### 7. 示例应用 DWR常用于实现动态搜索、实时数据更新、表单验证等场景。例如...

    org.liveSense.sample.gwt.notes-1.0.5.zip

    这个特定的模块可能是GWT项目的一部分,提供了某种笔记功能或示例。 描述 "org.liveSense.service.solr.configurationLoader.zip,基于solr的搜索服务配置加载器rivesense基于solr的搜索服务配置加载器" 强调了项目 ...

Global site tag (gtag.js) - Google Analytics