16.6.1 JSF portlet runtime

The JSF portlet runtime is the component that makes possible to run JSF applications as portlets in WebSphere Portal. The JSF portlet runtime is found in a different jar file for each portlet API:

For the JSR 168 API, the jar file is jsf-portlet.jar.

For the IBM Portlet API, the jar file is jsf-wp.jar.

Figure 16-5 shows how the JSF portlet runtime and the JSF servlet runtime interact with the common JSF runtime.

Figure 16-5 How the JSF portlet runtime interacts with the common JSF runtime

The common JSF runtime defines the elements that were covered in the previous sections. The only new element here is the variable resolver. The variable resolver determines the value of the first variable in an expression. For example, the standard variable resolver looks up managed beans and handles the predefined variables such as cookie, view and session.

The JSF servlet runtime is based on the FacesServlet, and is in charge of calling the JSF life cycle and creating an ExternalContext. Through the ExternalContext, the JSF application can access the servlet objects, such as ServletContext, ServletRequest and ServletResponse.

The JSF portlet runtime is based on the FacesPortlet, that accomplishes essentially the same tasks as the FacesServlet does. That is, it is in charge of calling the JSF life cycle and creating a PortletExternalContext. Through the PortletExternalContext, the JSF portlet can access the portlet objects, such as PortletContext, PortletRequest and PortletResponse.

The JSF portlet runtime also defines some portlet specific UI components, such as c2a for cooperation and person for people awareness.

Finally, the JSF portlet runtime defines a variable resolver that permits value-binding of portlet objects, such as PortletPreferences and PortletData.


Redbooks
ibm.com/redbooks