sun.com docs.sun.com My Sun Worldwide Sites

  Previous Contents Next

Project jMaki and Project Dynamic Faces

The Sun Web Developer Pack includes Project jMaki and Project Dynamic Faces, both of which allow you to encapsulate Ajax functionality in web components without requiring you to write any JavaScript, modify component code, or rewrite any of your application.

Wrapping Ajax-Enabled Widgets in Web Components Using Project jMaki

Project jMaki is a flexible framework for creating JavaScript-centric Web 2.0 applications. It includes a model for wrapping Ajax-enabled widgets, such as those from the Dojo toolkit, in JSP tag handlers and JavaServer Faces components. In this way, you can encapsulate the widget in a web component and also give it the benefits of any JSP tag handler or JavaServer Faces component. Project jMaki does all the work of creating the custom tag handler or custom JavaServer Faces component for you. You won't need to write another tag handler, component class, or component renderer by hand. It also includes a set of widgets already wrapped that you can drop into your applications.

Project jMaki also includes all the functionality you need to build Web 2.0 applications with these widgets, including:

  • A publish and subscribe mechanism so that you can listen for events fired by widgets and get widgets to interact with each other.

  • A generic proxy that allows widgets to communicate with external services.

  • A built-in templating mechanism.

See Chapter 3, Project jMaki for more information on Project jMaki.

Adding Ajax Functionality to JavaServer Faces Components Using Project Dynamic Faces

Project Dynamic Faces is another innovative project that provides a way to add Ajax functionality to a JavaServer Faces technology-based application. This project allows you to Ajax-enable any of the JavaServer Faces components that your web applications already use. You don't need to modify your components to give them the power of Ajax. Neither do you need to rewrite any of your application to add Ajax to it.

To add Ajax to your application, you identify the parts of the pages in your application that you want the Ajax functionality to update. As developers of JavaServer Faces technology-based applications know, a JavaServer Faces page is represented by a tree of components. With Dynamic Faces, you can identify which components in the tree should benefit from asynchronous updates.

Just as you use Ajax to update one part of the HTML DOM tree that represents the page, you use Dynamic Faces to update one part of the component tree that represents a JavaServer Faces page. Therefore, the Dynamic Faces paradigm is familiar to both Ajax developers and JavaServer Faces developers.

More importantly, Dynamic Faces leverages the JavaServer Faces component model to allow you to use Ajax capabilities in a more efficient way. Because of the collaborative nature of the component model, JavaScript technology events on some page components can cause asynchronous updates of any number of other components on the page. Dynamic Faces allows these asynchronous updates to occur as a result of only one Ajax request to the server rather than as a result of one Ajax request for each asynchronous update, thereby reducing the load on the server.

Dynamic Faces also leverages the JavaServer Faces component model to efficiently manage client-side and server-side state. When Dynamic Faces updates the state of the components on the client, it updates only the state that has changed -- and not the entire tree. The best part is that Dynamic Faces does all this behind the scenes, in a way that is completely consistent with the JavaServer Faces technology life cycle.

See Chapter 4, Project Dynamic Faces for more information on Project Dynamic Faces.

Previous Contents Next
Company Info Contact Terms of Use Privacy Copyright 1994-2007 Sun Microsystems, Inc.