12.7 Java Technologies
Sun Microsystems introduced the Java platform in 1995 as a new programming language and runtime environment ideally suited for Internet-related applications. We will discuss in this section some of Java technologies used for Internet programming.
JavaScript
JavaScript is an interpreted programming language with object-oriented capabilities. The core JavaScript language supports numbers, strings, and Boolean values as primitive data-types. It also includes built-in support for array, date, and regular expression objects.
JavaScript is most commonly used in web browsers, and, in that context, the general-purpose core is extended with objects that allow scripts to interact with the user, control the web browser, and alter the document content that appears within the web browser window. This embedded version of JavaScript runs scripts embedded within HTML web pages. It is commonly called client-side JavaScript to emphasize that scripts are run by the client computer rather than the web server (Flanagan 2006).
When a web browser is augmented with a JavaScript interpreter, it allows executable content to be distributed over the Internet in the form of JavaScript scripts.
Although JavaScript was the original scripting language for the Web and remains the most common by far, it is not the only one. The HTML specification is language agnostic, and browser vendors can support whatever scripting languages they choose. In practice, the only alternative to JavaScript is Microsoft's Visual Basic Scripting Edition, which is supported by Internet Explorer (Flanagan 2006).
12.7 Java Technologies
AJax
Jesse James Garrett, president of the Adaptive Path product-design consultancy, coined the acronym Ajax in 2005. However, companies actually began working with the technology several years earlier.
Ajax applications generally create JavaScript-based code that runs within the browser engine. The engine intercepts user inputs, displays requested material, and handles interactions on the client side. If the engine needs more data, it requests material from the server in the background, letting the user continue to interact with the program. The process utilizes asynchronous JavaScript, which an HTML page can use to make calls to the Web server to fetch documents. This lets an application make a server call, retrieve new data, and update the webpage without reloading all of the contents, which speeds up Web applications' performance, responsiveness, and interactivity (Lawton 2008).
Google Web toolkit
GWT is an open source Java software-development framework that lets Web developers use Java to create Ajax applications. It includes code libraries for use by developers. An advantage of GWT is that developers can leverage the extensive Java tools ecosystem when building Rich Internet applications (RIAs)-which have many of the features and functionality of desktop software even though they run online (Lawton 2008).
12.7 Java Technologies
Sun Microsystems' JavaFX
Java developers can use JavaFX, which Figure 3 shows, to write RIAs that run across platforms. Sun deploy JavaFX as an update to its Java client. The technology works with JavaFX Script, designed for easy use by interface programmers or visual designers familiar with scripting languages. Sun is working on a tool for designers who are more familiar with visual-layout tools.
JavaFX applications run inside their own containers directly on an operating system or on the browser via a plug-in (Lawton 2008).
12.7 Java Technologies
Figure 3: Sun Microsystems' JavaFX is a platform for building rich Internet applications, content, and services. The architecture consists of common elements-including 2Dgraphics, animation, text, and media-and device-specific elements for running the technology on desktops, mobile devices, or TVs (Lawton 2008).