Introduction
An overview of this tutorial. This chapter outlines the goals and prerequisites for completing this tutorial. This chapter includes the following topics:
Goals of This Tutorial
At the completion of this tutorial, you will:
have a basic understanding of several of the emerging web technologies like Ajax, Atom, RESTful web services, and scripting language-based web applications
understand how to develop and deploy interactive and dynamic web applications created using these technologies on Application Server 9.1.
Requirements for This Tutorial
A Checklist
To complete this tutorial, you need:
The tutorial bundle
Sun Java SystemApplication Server 9.1 (Glassfish v2)
NetBeans IDE 5.5.1 (optional) and the NetBeans plugin for Sun Web Developer Pack R2
Tutorial Overview
The Sun Web Developer Pack Tutorial is designed to help you get the most out of the new Web 2.0 technologies included in the Sun Web Developer Pack . This section provides basic background material to help you get the most out of the tutorial.
Introducing Web 2.0
The first generation of Web technologies, collectively referred to here as Web 1.0, is oriented towards consumables: mostly one-way arrangements in which users point and click their ways to retrieve information, or enter just enough information for a remote server to return specific search results, complete online transactions, or provide user interfaces for game consoles, chat rooms, and threaded forums. In this model, the backend programs and scripts on one server are largely self-contained, interact minimally with programs and scripts on other servers, and are relatively static in terms of they ways they can respond to changing conditions or user input.
As the Web continues to evolve towards what can be collectively referred to as Web 2.0, the Internet itself behaves more like a contiguous operating environment, in which components on one or more servers interact programmatically with components on other servers to create dynamic, flexible web—based applications and services that span multiple servers and other connected devices. These web—based applications and services consume and remix data from multiple sources, while at the same time making their own data available to other web applications and services. Moreover, in the Web 2.0 model, users have more active input into the way applications behave and dynamically change, through what Tim O'Reilly has referred to as an “architecture of participation” (Web 2.0: Compact Definition?).
While the specific definitions of Web 2.0 may vary, its most common technological themes include:
Dynamic user interfaces
Lightweight programming models
Lightweight web services
User collaboration and participation
The programming models and technologies behind these Web 2.0 themes are based on XML, XHTML, Java, SQL, PHP, and scripting languages such as JavaScript and Ruby. The physical infrastructure is made possible by advancements in processing, server, and networking hardware that provide exponentially higher speeds and throughput than even five years ago. To be sure, Web 2.0 applications require lightweight, responsive, open-standards software technologies and a scalable, distributed physical infrastructure in which dynamism and flexibility are of utmost importance.
As a pioneer in Web 1.0 and Web 2.0 software and hardware technologies, specifications, and open standards, Sun Microsystems has been providing dynamic, flexible, and powerful hardware and software tools that have helped drive the World Wide Web since its inception. The Sun Web Developer Pack is an important step in providing the software tools developers need to create applications and services for the Web 2.0 generation.
Sun Web Developer Pack and Bundled Web 2.0 Technologies
The lessons in the Sun Web Developer Pack Tutorial are based on core Web 2.0 concepts and the Web 2.0 technologies bundled in the Sun Web Developer Pack. These core concepts and technologies are briefly described below.
Dynamic User Interfaces – Dynamic user interfaces refer to a web application's responsiveness and its ability to interact more dynamically with actions you take on its web pages. Using Asynchronous JavaScript and XML (Ajax) technologies to build more interactive user interfaces, Ajax enables web application users to asynchronously update and retrieve data from a server without having to wait for a screen refresh. Of particular importance here in the Java space are Sun Microsystems' jMaki and DynaFaces technologies.
jMaki tools enable developers to wrap any widget in a JSP tag or a JSF component so the widget can be easily implemented in a Web application.
DynaFaces focuses on enabling JSF developers to Ajax-enable the JSF components they already use.
In addition to jMaki and Dynafaces, a third-party JavaScript library, called Dojo, is also included in the Sun Web Developer Pack.
Lightweight Programming Models – Platform-agnostic scripting languages are becoming increasingly popular with web application developers because of their flexibility and because they often allow for more rapid development than previous coding techniques. While no one scripting language is dominant at this time, Ruby and JavaScript are among the most popular. In response to this popularity, the Sun Web Developer Pack includes technology from the Phobos project, which provides an application framework that enables you to develop web applications entirely in a scripting language, while still providing access to the entire Java EE stack. Phobos currently supports only JavaScript, but support for other scripting languages is planned with the help of JSR 223 (Scripting for the Java Platform).
Lightweight Web Services – The Representation State Transfer Technology (REST) architectural model emphasizes building web services that can be accessed as resources by means of the common HTTP GET, POST, PUT, and DELETE operations. The technologies included in the Sun Web Developer Pack that facilitate REST style coding are:
ROME – (RSS and Atom Utilities) API for processing and generating syndication feeds
WADL – (Web Application Description Language) Web services description language like WSDL, but designed for REST-based Web services by supporting the base set of HTTP methods for accessing resources
Atom – XML-based format for syndication feeds and a publishing protocol that provides CRUD (Create, Read, Update, Delete) support for REST-based Web services
More complete explanations and usage instructions for these technologies are provided in the relevant chapters later in this tutorial.