Combined power of multiple factories

In the last several sections, you saw how to customize and configure the most used JSF factories. In the final section of this chapter, you will see how to exploit a few factories in the same application. For example, a convenient scenario will assume that we want to fire a non-JSF request and get as response a JSF view. An approach of this scenario consists in writing a Java Servlet capable of converting a non-JSF request into a JSF view.

In order to write such a Servlet, we need to obtain access to FacesContext. For this, we can combine the power of the default LifecycleFactory class with the power of the default FacesContextFactory class. Further, we can access Application via FacesContext, which means that ...

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.