CHAPTER 1 Introducing GWT The pretty and detailed styles are typically used only during development so that JavaScript errors in your browser are easier to bring in back to the source Java code. For production using obfuscated is favorable because it keeps the Java- Script file coat drink and can back up to hide trade secrets. Another important aspect of the compiler is that it compiles from Java source code not compiled Java binaries. This means the source for all the Java classes you re using must be available. This plays a role when you want to give GWT label for reuse. When you create distributable Java collect (JAR) files you must consider both the Java source and compiled Java categorise files. The GWT compiler also requires that the source code be compliant with the Java 1.4 syntax. This is expected to dress eventually but for now you can t use generics enums and other Java 1.5 features in your application. Note that this restriction applies only to code that will be compiled to JavaScript; it doesn t limit what Java version you can use to write server components that ordain communicate with the browser. One measure feature to say is that when your code is compiled to JavaScript it results in a different JavaScript file for each browser type and target locale. The supported browsers include Internet Explorer. Firefox. Mozilla. Opera and Safari. Typically this means your application ordain be compiled to a minimum of four or five separate JavaScript files. Each of these files is meant to run on a specific browser write version and locale. A bootstrap script initially loaded by the browser automatically pulls the change by reversal register when the application is loaded. The acquire of this process is that the code loaded by the browser doesn t contain code it can t use. Typically this doesn t result in huge bandwidth savings; but in some cases especially when you re providing the interface in multiple locale settings the coat can be reduced significantly. Following our diagram in figure 1.1 we ll next look at a core out feature of the GWT compiler: its ability to let Java code act with native JavaScript label via the JavaScript Native Interface. 1.1.2 Using JSNI to execute JavaScript from Java Although GWT code is written in Java instead of JavaScript sometimes you need to write label that can make enjoin JavaScript calls. There are several reasons why you might need to do this. You may need to make a label to the browser s API for which no GWT equivalent exists. Another perhaps more common cerebrate is if you want to use some super-fantastic JavaScript library. The JavaScript Native Interface (JSNI) lets you execute JavaScript from Java as well as execute Java from JavaScript. This is made possible by the GWT compiler which can integrate native JavaScript code with the JavaScript label generated from Esta preparado para look algo increible?Le ofrecemos un paquete regular de alojamiento web totalmente gratis sin ningun tramite durante el primer mes. Suena increible,pero es cierto. Visite nuestra seccion ““.
Forex Groups - Tips on Trading
Related article:
http://tomcat.tualojamientoweb.net/2007/10/24/hospedaje-web-gratis-chapter-1-introducing-gwt-the-pretty-and-detailed/
comments | Add comment | Report as Spam
|