Coming Up for Air

The migration of Mojarra Scales to JSF 2, adding new components has become much easier due to JSF 2’s new composite component feature. In the past couple of weeks, this new capability has paid off in spades as Mojarra Scales has gotten (so far) three new components in rapid succession. In this, the first part of a multi-part series, we’ll take a look at the most complex of the new components, sc:dataTable.

As a "computer guy," I get asked to help with all things computer-related. My church’s web site is no different. I was recently asked to help set up a new site. Since my time is limited and they need to get things going without waiting on me, I thought I would document my process for them, simple as it is. It occurred to me that it might be generally useful, so here it is. If I was wrong about that, please feel free to keep surfing. :)

With the recent migration of Mojarra Scales to JSF 2, the old location of the Mojarra Scales demo was no longer adequate (upgrading that server posed some issues). For that reason, I have moved the demo to a new home. This server should be more up-to-date (both in terms of the application as well as the application server — which is GlassFish v3, of course — that runs it). When accessing the application, please keep in mind that it’s on an old server that’s running on an AT&T U-verse line, and the download times will reflect that. :)

I’d also like to not that this showcases a couple of new components at the moment. I’ve begun an implementation of the YUI data table widget. At the time of this posting, basic table functions work, including client-side sorting. More complex functionality, such as Ajax updates, are in the offing.

Another new component, which the demo uses extensively, is the excellent SyntaxHighligher script from Alex Gorbatchev. The demo uses this new component to show the page source for each demo, finally allowing you to see a given component in action, as well seeing the page markup that makes those components. The demo is still in flux, so some things aren’t quite "perfect" yet. For example, Safari really hates the markup the demo produces, which is a bug in the demo application itself. Hopefully, that will soon be fixed. For now, Safari users will need to use another browser.

As I’ve noted, Scales has been migrated to JSF 2. While most components are working as expected, there are likely some minor issues to work out. If you run into any of these issues, or if you’d like to see extra functionality in any of the components, please feel free to file an issue on the Scales issue tracker on the Kenai project site.

While JSF has had Ajax support for a long time now, it has always been through external libraries such as Ajax4Jsf/RichFaces, ICEfaces, DWR, DynaFaces, etc. With JSF 2, the framework now has first class, standardized support for Ajax. This is good news on several fronts. For those that want Ajax support but would rather not import another library, that capability is now baked in, and, for those familiar with a4j or DynaFaces, it should look very familiar. However, for those that don’t mind the external dependency, the standardized Ajax will make it much easier to mix and match component libraries on the same page, an issue that has plagued JSF for while. In this post, I’d like to take the first approach and show how easy it is to achieve Ajaxy updates on your h:dataTable using only standard JSF.

glassfish color small

During the GlassFish v3 Prelude development cycle, the GlassFish team launched an initiative called FishCAT, which is our Community Acceptance Testing program. The program was very successful for Prelude, resulting in many, many reported (and fixed! : ) issues for the Prelude release. As we press hard toward the release of GlassFish v3 final later this fall, this program has been re-launched to help us engage our user community. Through this program, testers will have a much greater impact on the final quality of the product when it finally ships. If you’d like more information, you can see the announcement here, and a description of the program here. If you’d like to sign up and help, the application can be found here.

Late last night, I published Mojarra Scales 1.3.2. This is mostly a bug and performance fix, but here are some highlights from the release:

  • <sc:links /> (and related supporting classes and components) was modified to allow files only from /scales to fix a pretty glaring security hole in some scenarios

  • When multiple, local requests for a given resource type (CSS or JS) are queued, they are now rendered to the page in such a way that they will be returned in a single request. That is to say, Mojarra Scales will now concatenate these files into one response, so as to reduce the number of network operations.

  • Scales now correctly handles cached files. When a CSS or JS resource is sent, Scales now employs etags to help the client cache the file properly. On subsequent requests, if the client sends the last modified header, Scales properly handles the date, returning 304 when appropriate

  • <tab/> now supports the style and styleClass attributes.

  • The multi-file upload component has been moved out of the main jar into its own artifact so that those not using the component will have a smaller deployment. This component can be found under the upload artifactId in the maven repository.

The jar files, including the demo app, can be downloaded from kenai.com or via maven (the demo is not in maven).

With the architectural changes in 1.3 out of the way, the next version of Scales should include more components, as well as enhancements to existing components. At some point, the project will be branched for a migration to JSF 2. With the spec being final and Mojarra 2 scheduled to ship in a couple of weeks, it seems the time is right for the move. Time will tell, of course, how soon that move is made.

If you have any issues, please comment in the forum.

I should note here, for those that don’t follow me on Twitter, that I have updated and expanded my About page, for those that are interested in that sort of thing. A word of warning: There’s some personal stuff in there! :)

It just occurred to me that I never posted my final wrap up on JavaOne 2009. While it may be that, at this last date, no one cares anymore, I feel I should finish what I started, even if only for me. With that said, here’s my closing thoughts on what I hope is NOT the last JavaOne.

Search

    Quotes

    Sample quote

    Quote source

    About

    My name is Jason Lee. I am a software developer living in the middle of Oklahoma. I’ve been a professional developer since 1997, using a variety of languages, including Java, Javascript, PHP, Python, Delphi, and even a bit of C#. I currently work for Red Hat on the WildFly/EAP team, where, among other things, I maintain integrations for some MicroProfile specs, OpenTelemetry, Micrometer, Jakarta Faces, and Bean Validation. (Full resume here. LinkedIn profile)

    I am the president of the Oklahoma City JUG, and an occasional speaker at the JUG and a variety of technical conferences.

    On the personal side, I’m active in my church, and enjoy bass guitar, running, fishing, and a variety of martial arts. I’m also married to a beautiful woman, and have two boys, who, thankfully, look like their mother.

    My Links

    Publications