Wednesday Jan 22, 2014

JSF 2.2 View Actions

View parameters and pre-render view event listeners were two of the key features added in the JSF 2.0/2.1/Java EE 6 time frame to improve bookmarkability and HTTP GET support. However, the problem with the pre-render view event is that it is triggered both when the view initially loads as well as on all subsequent JSF post backs. This makes it harder to use for the common pattern of looking at passed-in page parameters (usually in the URL query string) and doing some page initialization only once. You could get around this by putting in an explicit post back check in your listener, which is often hard to miss and somewhat hard to understand. As a result, the Seam 3 Faces module added a more focused and powerful view action component.

The good news is that JSF 2.2 standardizes the popular Seam 3 view action feature all but as-is. Hantsy Bai explains the very useful new feature well, including a good bit of technical detail.

Friday Dec 27, 2013

A Realistic JSF 2.2 Faces Flows Example

While very basic introductory examples are invaluable in explaining a new API, they can fail to do a rich API justice - especially from the perspective of more experienced developers. For some of us, looking at a slightly more involved, realistic example can shed far better light on the practical value proposition for a technology.

Faces Flows are one of the best hidden gems in Java EE 7. Standardized in JSF 2.2 they enable web application flow state management in an elegant, declarative fashion. In an excellent blog post, Liferay Faces project lead and JSF 2.2 expert group member Neil Griffin takes an in-depth look at Faces Flows. He explains the motivation for the feature, contrasts it with the Java EE 6/CDI 1.0 conversation scope and demonstrates the feature using a very realistic use case and non-trivial example code. There's also the video of Ed Burns and Roger Kitain's JavaOne 2013 JSF 2.2 talk on Parleys.com:

The source slide deck for the talk - titled JSF 2.2 New Features in Context is posted on the JavaOne Content Catalog. Make sure to check out the other great JavaOne 2013 sessions on Parleys.com too!

Thursday Dec 19, 2013

JSF 2.2 New Features in Context

"If the smaller characters are well-written, the whole world of the film becomes enriched. 
It's not the size of the thing, but the detail." 
(Brendan Gleeson)

A lot of airtime is spent on the APIs that were added to Java EE 7 (e.g. WebSocket) and APIs that went through a major revision (e.g. JMS 2.0 or JAX-RS 2.0). But let's not forget that a lot of others APIs have been revised in Java EE 7 and this sometime implies new features, new capabilities.

In this JavaOne session, Roger Kitain and Edward Burns who are both Specification Leads for JavaServer Faces, explains in details some of the important features that were added to JSF 2.2 (e.g. Faces Flow, HTML5-friendly markup, Resource library contracts). Those new features are explained in detail and demonstrated in the context of a self-contained sample application. Ed and Roger also shows that JSF is still relevant in today's enterprise software stack, they finally compares the benefits of upgrading to JSF 2.2 against opting for a totally new architecture.

Thursday Nov 14, 2013

JSF Specification Lead Ed Burns Discusses JSF 2.2 and Java EE7

If you are a JSF user you owe it to yourself to know about JSFCentral. Run by key JSF advocate, consultant and JSF in Action author Kito Mann, it's an excellent resource for everything JSF. In a recent podcast on JSFCentral, Kito chats with celebrated JSF specification lead Ed Burns about JSF 2.2 and Java EE 7. It's an extremely insightful but informal discussion between two powerhouses of the JSF ecosystem. The discussion covers JSF 2.2 features such as HTML 5 support, the flow scope, resource library contracts and CDI alignment as well as Java EE 7, all in the context of broader industry trends. You can read the transcript and listen to the podcast here. There's also the brief JSF 2.2 video from Ed Burns on the GlassFish Videos YouTube channel:

More recently, Ed presented a JavaOne 2013 session titled JSF 2.2 New Features in Context. Stay tuned to Parleys.com for video of the session to be posted (the slide deck is already posted on the linked JavaOne Content Catalog).