16.6.2 Mapping between portlet phases and JSF phases

Figure 16-6 shows the mapping between the portlet an JSF phases. This mapping is showing the portlets methods that are invoked in JSR 168 portlets, but the mapping is analogous in IBM API portlets.

Figure 16-6 Mapping between portlet phases and JSF phases

As we know, portlets have two processing phases: the action phase and the render phase.

If the portlet fired an action, it will send an action request to the server. An example of firing an action is submitting a form or clicking a link. In this case, the WebSphere Portal runtime will call both the action phase and the render phase of the portlet. In the action phase, the FacesPortlet.processAction method is invoked and it calls the five first phases of the JSF life cycle. In the render phase, the FacesPortlet.render method is invoked and it calls the remaining phase of the JSF life cycle.

There are times when the server receives only a render request, instead of an action request. An example is when you have portlets A and B in the same page and the user interacts with portlet A. While portlet A will process the action and render again, portlet B will only have to be rendered, because there are no actions associated with it. In this case, the WebSphere Portal runtime will call only the FacesPortlet.render method of portlet B. The FacesPortlet.render method will call all six JSF life cycle phases, but since there are no parameters associated with the request, most of the life cycle phases will be skipped.


Redbooks
ibm.com/redbooks