YOUR FEEDBACK
Rapid Module Development for DotNetNuke
MICHEAL SMITH wrote: GO TO THE LINK, U HAVE EVERYTHING U WANT THERE. MICHEAL...
SOA World Conference
Virtualization Conference
$50 Savings Expire May 23, 2008... – Register Today!

SYS-CON.TV

2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
TOP THREE LINKS YOU MUST CLICK ON


AjaxWorld Special: Creating AJAX and Rich Internet Components with JSF
AJAX has gained momentum primarily due to the "XMLHttpRequest" browser object which supports asynchronous communication

Digg This!

Page 1 of 3   next page »

This article is based on, and contains excerpts from, the book Pro JSF: Building Rich Internet Components by Jonas Jacobi and John Fallows, published by Apress. Book is now available on fine bookstores and Amazon as of February 25, 2006.

JavaServer Faces (JSF) standardizes the server-side component model for Web application development but doesn't standardize the presentation layer at the browser. In a series of articles we are going to look at how JSF can fulfill new presentation requirements without sacrificing application developer productivity building Rich Internet Applications (RIA).

Consumer Requirements
It's always the end user who feels the effect of any chosen technology, especially at the presentation layer. The end-user experience should be top priority for any developer building applications, whether they are Web applications or desktop applications. End users demand feature-rich and highly interactive user interfaces.

Introduction to Rich Internet Technologies
Web application developers today are faced with higher demand for richer functionality using technologies such as HTML, CSS, JavaScript, and DOM. These technologies were not developed with enterprise applications in mind and, with increasing pressure from consumers to provide applications with features not fully described or supported by these technologies, developers are looking for alternative solutions or extensions to these standards.

From a combination of both consumer requirements and developer needs, a new breed of Web technologies has evolved. Often referred to as Rich Internet Technologies, these technologies enhance the traditionally static content provided by Web applications.

In the absence of sufficiently powerful standards, new technologies such as Mozilla's XUL, Microsoft's HTC, Java applets, Flex, and OpenLaszlo have emerged to meet the requirements. Such technologies support application-specific extensions to traditional HTML markup while still leveraging the benefits of deploying an application to a central HTTP server. XMLHTTP has also returned under a newly branded name, AJAX (Asynchronous JavaScript and XML). Applications built with these technologies are often referred to as Rich Internet Applications (RIA).

In this article series we are going to focus on AJAX and XUL to illustrate the potential that JSF brings to the JavaEE developer.

AJAX
AJAX has gained momentum primarily due to the XMLHttpRequest browser object, which supports asynchronous communication with any business services used by the Web application. Popular sites such as Google Mail and Google Suggest use AJAX to deliver RIA.

With the XMLHttpRequest object, developers can now send requests to the Web server to retrieve only the data needed and use JavaScript to process the response.This ability to reduce the amount of data transferred between client and Web server reduces the bandwidth to a minimum and saves processing time on the server since most of the processing is done on the client using JavaScript.

It is important to note that the XMLHttpRequest object, although widely used, could at best be called a "de facto" standard, since most browsers, including Firefox, Inter-net Explorer, Opera, and Safari, support it. It is also worth noting that the XMLHttpRequest object is not exclusive to AJAX; potentially the XMLHttpRequest object can be used by any HTML/XML-based Web technology such as XUL or HTC.

Desktop vs Web
Traditional Web applications are in most cases slower than their counterpart desktop applications. With AJAX we can now send requests to the Web server to retrieve only the data needed and use JavaScript to process the response, which leads to a more responsive Web application.

A typical AJAX application leverages standard HTML/XHTML at the presentation layer and uses JavaScript to dynamically change the DOM. This creates an effect of "richness" in the user interface with no dependency on additional browser plug-ins.

Mozilla XUL
XUL (pronounced zool) was created by the Mozilla organization (Mozilla.org) as an open source project in 1998. With XUL, developers can build rich user interfaces that may be deployed either as "thin client" Web applications, locally on a desktop, or as Internet-enabled "thick client" desktop applications. To fully provide the consumer with a rich user interfaces, XUL needs to execute in the Mozilla Gecko Runtime Environment (GRE). There are many examples of applications using XUL, including the Firefox browser, the Thunderbird e-mail client, and numerous plug-ins to each.

XUL Structure
The base idea behind XUL is to provide a markup for building user interfaces much like HTML, and to leverage technologies such as CSS for look-and-feel and JavaScript for events and behavior. There are even APIs available to access files systems and Web services over the network. As an XML language, XUL can be also be used in combination with other XML languages, such as XHTML and SVG.

XUL Components
XUL comes with a base set of components that are available through the Mozilla GRE, and has the added benefit of not needing to download components to display an application in the browser. You can also design your own components with XUL; these will need to be downloaded on request and cached in the browser.

XUL uses a language called XBL (eXtensible Binding Language) to define new components. XBL is also used to bridge the gap between XUL and HTML, making it easy to attach behavior to traditional HTML markup.

Listing 1 is a sample XUL file that embeds XUL elements and standard, name-spaced HTML elements.

XUL Event Handling
Using XUL event handling is not that different from using HTML event handling. The GRE implementation supports DOM Level 2 (and partially DOM Level 3) and is virtually the same for HTML and XUL, and changes to the state and events are propagated through a range of DOM calls. XUL elements come with predefined event handlers, much like the event handlers provided with the standard HTML elements (see Listing 2).

As in HTML, developers can use JavaScript functions located in external libraries, or embedded in the page.

<script type="text/javascript"src="http://
www.bob.org/js/myscript.js">

There is a large set of built-in XUL components, each with its own set of event handler attributes. For example, the XUL window element delivers events such as load and paint.

Creating Custom XUL Components Using XBL
XBL is an XML language that allows developers to extend XUL by adding "custom" components to the extensive set of existing XUL elements. In XUL, developers can define the look and feel using CSS, and they can define the behavior using XBL.

Developers can look at XUL as the "implementation" that comes with a pre-set of components, or tag libraries that can be used to build a user interface, much like the JSF Reference Implementation. XBL is the language developers use to extend XUL components and enable integration with HTML, in much the same way that Java is used to extend JSF components.

XBL Structure
An XBL file contains a set of bindings, each describing the behavior, properties, and methods of an XUL component.

A quick look at Listing 3 shows the root <bindings> element containing two binding elements. A <bindings> element can contain any number of <binding> elements. The namespace in the <bindings> element defines which syntax will be used, and in Listing 3 it is XBL - xmlns=http://www.mozilla.org/xbl. The file also contains a combination of XUL and HTML elements <xul:text/> and <html:input/>. This is extremely useful for simplifying development by encapsulating several components as a single, reusable component. The xbl:inherits attribute allows the text element to inherit values from the bound element by defining a variable called name and assigns it to the value attribute. If no value is defined when the component is used in a page, the text field's value will default to "Guest".


Page 1 of 3   next page »

About Jonas Jacobi
Jonas Jacobi is co-founder and chief executive officer of Kaazing Corporation. A native of Sweden, Jacobi has worked in the software industry for more than 15 years with a mission to simplify application development. Prior to founding Kaazing, he worked for Oracle for eight years as a Java EE evangelist and product manager responsible for the product management of JavaServer Faces, Oracle ADF Faces, and Oracle ADF Faces Rich Client in the Oracle JDeveloper team. As co-founder and CEO of Kaazing, Jonas sets the company's business and product strategy and oversees all aspects of Kaazing's operations and mission to become the world-wide leader in real-time software. He is co-author of the best-selling book, "Pro JSF and Ajax: Building Rich Internet Components," (Apress).

About John Fallows
John Fallows is a pioneer in the field of rich and highly interactive user interfaces and co-founder of Kaazing Corporation. He recently worked as Architect at Brane Corporation, a startup company based in Redwood City, California. Originally from Northern Ireland, Mr. Fallows graduated from Cambridge University in the United Kingdom and has worked in the software industry for more than ten years. Prior to joining Brane, Mr. Fallows was a Consulting Member of Technical Staff for Server Technologies at Oracle Corporation. During his last 5 years at Oracle, Mr. Fallows focused on designing, developing, and evolving Oracle ADF Faces to fully integrate Ajax technologies. Mr. Fallows has written several articles for leading IT magazines such as Java Developer's Journal, AjaxWorld Magazine, and JavaMagazine (DE), and is a popular speaker at international conferences. Mr. Fallows is co-author of the recently published book Pro JSF and Ajax: Building Rich Internet Components, (Apress). In his role as chief technology officer, Mr. Fallows formulates the Kaazing Corporation's vision of creating the best real-time Web framework based on the Java standard. He defines the architecture of the Kaazing product suite and oversees its development.

SYS-CON Belgium News Desk wrote: JavaServer Faces (JSF) standardizes the server-side component model for Web application development but doesn't standardize the presentation layer at the browser. In a series of articles we are going to look at how JSF can fulfill new presentation requirements without sacrificing application developer productivity building Rich Internet Applications (RIA). AJAX has gained momentum primarily due to the XMLHttpRequest browser object, which supports asynchronous communication with any business services used by the Web application. Popular sites such as Google Mail and Google Suggest use AJAX to deliver RIA.
read & respond »
SYS-CON Australia News Desk wrote: JavaServer Faces (JSF) standardizes the server-side component model for Web application development but doesn't standardize the presentation layer at the browser. In a series of articles we are going to look at how JSF can fulfill new presentation requirements without sacrificing application developer productivity building Rich Internet Applications (RIA). AJAX has gained momentum primarily due to the XMLHttpRequest browser object, which supports asynchronous communication with any business services used by the Web application. Popular sites such as Google Mail and Google Suggest use AJAX to deliver RIA.
read & respond »
Jonas Jacobi wrote: Hi Reza, Thank you for those kind words. We totally agree with you that the combination of JSF, Ajax, and XUL is a very powerful combination. Part 2 has already been published - http://jdj.sy s-con.com/read/171490.htm These articles are also based on content from our book Pro JSF and Ajax was recently released - http: //apress.com/book/bookDis play.html?bID=10044 Cheers, Jonas
read & respond »
Reza wrote: Thank you for your very intresting article. yes JSF ,Ajax and XUL are lost part of RIA and you find them greatly in your article. i am waiting for next part. Thank you again. Reza
read & respond »
Jonas Jacobi wrote: Hi newbie, The easiest way of getting up to speed with XUL and XBL is to visit XUL Planet - http://www.xulplanet.com/ XUL Planet has proved to be a very good source for us when working on our book ([URL]Pro JSF: Building Rich Internet Components[/URL]) and its samples. Another good source is, of course, Mozilla's web site - http ://www.mozilla.org/projec ts/xul/ Cheers, Jonas
read & respond »
LATEST AJAXWORLD STORIES
3rd International Virtualization Conference & Expo: Themes & Topics
From Application Virtualization to Xen, a round-up of the virtualization themes & topics being discussed in NYC June 23-24, 2008 by the world-class speaker faculty at the 3rd International Virtualization Conference & Expo being held by SYS-CON Events in The Roosevelt Hotel, in mi
AJAX World - You've Heard of Widgets, But What Are Woodgets?
DreamFace DataWidgets have gotten a lot of press lately, but what are Woodgets? DreamFace Interactive CEO, Olivier Poupeney gets specific about woodgets while presenting key differentiators of DreamFace's Web 2.0 Open Source Framework in his interview with Jeremy Geelan for SYS-C
JavaOne 2008: Sun Talks Up its Late-to-the-Party AIR-Silverlight Rival
At Java One this week Sun has been selling its year -old-but-still-upcoming - and definitely late-to-the-party - Adobe AIR- and Microsoft Silverlight-competitive JavaFX Rich Client environment as a potential revenue-generator capable of putting ads on mobile applications and JavaF
Payless Car Rental Launches iPhone and iPod Touch Portal
Payless Car Rental has launched an iPhone and iPod Touch optimized website. Payless Car Rental is a car rental agency that built a customized version of its website for the iPhone and iPod Touch. The homepage of Payless' iPhone interface also features a 'Call to Book' button that
Alpha Five Platinum Brings AJAX to the Enterprise
Alpha Software is now shipping Alpha Five Platinum Edition, the ninth release of the company's flagship Web database development platform. It's a development tool that can visually build AJAX-powered applications, integrate SQL databases with drag+drop simplicity, and deliver ent
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE