Facelets' programmatic aspects

In the second part of this chapter, we will focus more on several programmatic aspects of Facelets. We will start with a new feature of JSF 2.2 regarding FaceletFactory, which produces Facelets relative to the context of the underlying implementation.

FaceletFactory considerations

In JSF 2.0, the FaceletFactory class was not accessible via the standard API for accessing factories, FactoryFinder. This means that something like the following line was not working:

FaceletFactory faceletFactory = (FaceletFactory)
FactoryFinder.getFactory(javax.faces.view.facelets.FaceletFactory);

But starting with JSF 2.2, the preceding snippet of code should work. At least this is what the list of JSF 2.2 features said. Unfortunately, it ...

Get Mastering JavaServer Faces 2.2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.