The Source for Java Technology Collaboration
User: Password:



Greg Murray's Blog

May 2006 Archives


Creating AJAX Enabled JSF Components

Posted by gmurray71 on May 25, 2006 at 09:08 PM | Permalink | Comments (5)

There is a class of applications and developers that Java Server Faces suites well. JSF is well suited for those that do not want to deal with the intricacies of learning CSS, JavaScript, and DHTML. Once a component is properly created it can be re-used. That said getting all the moving parts in order can take some doing.

Including AJAX Functionality in a Custom JavaServer Faces Component shows the Phase Listener approach of JSF component development. This is the approach taken with the Java BluePrints AJAX Components/ whih run in Creator and are also used in the Java Pet Store 2.0. Shale Remoting provides a framework for developing JSF components using this approach.

In this example JSF manages the renders the links to JavaScript. JavaScript renders the view on the client. A phase listener is used to manage AJAX call which update the model contained in session scoped beans. There may be some that do not favor an approach where JavaScript is doing much of the rendering of the view as there is not an exact representation of what is being displayed on the client maintained on the server. With some dynamic UIs, especially those that use existing JavaScript libraries out there, it is difficult to keep and exact representation on the client and server. When JavaScript is dynamically managing the view on the client the component developer needs to consider how the data that the component will be validated, how the component is relates to the components around it, and how chatty the client will be with the server. These issues occur because the phase listener jumps you out of the normal JSF lifecycle processing for processing AJAX requests.

There are other approaches that are being developed on top of JSF 1.2 and for the future JSF 2.0 that will allow for more granular updates to client/server representation of the view transparently using AJAX. This approach allows existing JSF components to use the standard validators and rendering logic and does not require a developer to have extensive knowledge of AJAX. This approach is being developed as part of the JSF Extensions.

Check out the tutorial and let us know aht you think.



Introducing jMaki - AJAX Widgets for the Java Developer

Posted by gmurray71 on May 17, 2006 at 05:45 PM | Permalink | Comments (0)

jMaki is all about enabling Java developers to use JavaScript in their Java based applications as either a JSP tag library or a JSF component. jMaki uses the best parts of Java and the best parts of JavaScript to deliver a rich AJAX style widgets.

jMaki promotes a program methodology that cleanly separates behavior (JavaScript), from Styles (CSS), from template HTML. jMaki put the right pieces together using Java to render the initial page. In the case of both the JSF component and the JSP tag the inputs are the same and the output should be the same. The service behind the widget may differ if there is one.

Under the covers jMaki widgets are re-usable parameterized JavaScript widgets. jMaki makes sure the proper parameters passed to individual widget code using a JavaScript bootrapper that initalizes the widgets in a page. In the case of both JSP tags and JSF the inputs (a JavaScript/CSS/Template HTML file) produce the same resulting widget. jMaki's design makes it very easy to create widgets and support upcoming JavaScript libraries. These widgets are fully configurable in a running web application.

For more on jMaki widgets see https://ajax.dev.java.net/widget-developer.html.

Geertjan's Weblog contains some useful details on JMaki. Check out Project jMaki, it is BSD and we're looking for help.





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds