Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

JSF: The Good, the Bad, and Yes, the Ugly

DZone's Guide to

JSF: The Good, the Bad, and Yes, the Ugly

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more – name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

Having bagged on JSF quite a bit (mostly for its glacial feature pace), still, after squirming around with it, I find myself liking where it ends up going. This is in large part because I am a big believer in a. binding, b. components, and c. pages that don‘t contain any code. When I get to the finish stage on most ui pieces, I end up doing lots of starts, tuning CSS. Should probably think about taking the html out and fiddling with it in another tool. Thoughts on that are welcome.

In the most recent JSF tour, we were doing a wizard and had to bind to checkboxes. That turned into a nightmare, and for all the typical JSF reasons. JSF gets a low grade for heuristics (intuition is rarely the road to figuring things out). For instance, what would you think would happen if:

  1. had an entity that has one or more features
  2. those features each are modeled as Enums
  3. you want to give the User the ability to checkoff the ones that apply for the given instance of said Entity

Surely, a framework that has been around for 8 years should have no problem with this. Well, in fact, it doesn‘t work. It makes sense that the great Enum converter (more on that, somehow the for-class doesn‘t work on that anymore), would not work for this binding since we are doing a collection, but is this really that complicated? First inclination was to make an EnumSetConverter, after all, the individual Enums were being converted (to its own string format :: (makes you nostalgic for C++)). So the EnumSetConverter would just have one additional step: first split on space (since each selected feature will come in one string with spaces between), then with each token, just invoke the normal EnumConverter.

But that didn‘t work. Turns out there‘s a bug in the 1.2 RI and the converter never gets called. More surprisingly, in the bug discussion, they say that they are going to drop support for converters on checkboxes. The problem is that this leaves you having to bind to some intermediary value, and then perform nothing more than a straight conversion (or write your own component that does support a converter).

From http://www.jroller.com/robwilliams

Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. Our APIs verify, standardize, and correct the Big 4 + more – name, email, phone and global addresses – to ensure accurate delivery, prevent blacklisting and identify risks in real-time.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}