Sun Java System Portal Server 7 Configuration Guide

Mapping Actions of JSF Application to Portal Application and Vice-Versa

Table 9–1 JSF to Portal Mapping

When the JSF Application 

On the Portal 

Execute any action in the application 

The processAction() method of JSF Portlet is called which calls the execute() method of JSF Lifecycle. Then the render() method of JSF Portlet is called which calls the render method of JSF Lifecycle and returns content using PortletRequestDispatcher.include().

Executing the action results in a error 

The processAction() method of JSF Portlet is called which calls the execute() method of JSF Lifecycle. Then render() method of JSF Portlet is called which calls the render() method of JSF Lifecycle and returns the error message using PortletRequestDispatcher.include().

The scope of the JSF Component or backing beans is request 

When a JSF application is running in a servlet environment, the JSF request begins and ends within the scope of a servlet request (a user request). However, when a JSF application is running in a portlet environment, the JSF request lifecycle is split in two portlet requests. All JSF lifecycle phases but render happen during the portlet processAction request, with the JSF lifecycle render phase happening during the portlet render request.  

Table 9–2 Portal to JSF Mapping

On a Portal 

The JSF Application 

Click on a JSF portlet Edit button 

Edit page is displayed if portlet init parameter com.sun.faces.portlet.INIT_EDIT is set to the edit page; otherwise, a message indicating what needs to be done is displayed.

Click on a JSF portlet Help button 

Help page is displayed if portlet init parameter com.sun.faces.portlet.INIT_HELP is set to the help page; otherwise, a message indicating what needs to be done is displayed.

Click on a JSF portlet Maximize button 

The render() method of JSF Portlet is called which calls the render method of JSF Lifecycle and it returns content using PortletRequestDispatcher.include(). Therefore, the maximize window displays the same context which were shown on portlet window before clicking maximize button.

Click on a JSF portlet Minimize button 

Request is handled at the portlet level and the JSF application remains unaware of it. The desktop displays the minimized window as it displays for any other JSR 168 portlet.  

Click on a Normalize button of the minimized JSF portlet 

The render() method of JSF Portlet is called which calls the render method of JSF Lifecycle and it returns content using PortletRequestDispatcher.include(). Therefore, the normalized window displays the same content which was shown on portlet window before clicking the minimize button.

Click on a JSF portlet Detach button 

The render() method of JSF Portlet is called which calls the render method of JSF Lifecycle and it returns content using PortletRequestDispatcher.include(). Portal server uses this content to display in a new window. Therefore, the detached window displays the same content which was shown on portlet window before clicking the detach button.

After detaching, click on a JSF portlet Attach button 

The render() method of JSF Portlet is called which calls the render method of JSF Lifecycle and it returns content using PortletRequestDispatcher.include(). Portal server uses this content to display in the portlet window. The content shown is same as was shown in the detached window before clicking the attach button.

Remove the JSF portlet from a page and then add it again 

On removal, the request is handled at the portal/portlet level and on adding it again, the render() method is called. The jsf-portlet window displays the same content which was shown on portlet window before removing this portlet (that is, the state is maintained). The remove and add have to occur in the same login session while the same DesktopContext object exists. For example, if the desktop session reap interval setting is set low enough (say 30 second), and you remove a JSF portlet, then wait 2 minutes and then add it again, the state will be lost.

Click reload of the portal page 

The render() method of JSF Portlet is called which calls the render method of JSF Lifecycle and it returns content using PortletRequestDispatcher.include(). The jsf-portlet window displays the same content which was shown on portlet window before clicking the reload button.

Click on another tab and then click back on the tab that contains the JSF portlet 

The render() method of JSF Portlet is called which calls the render method of JSF Lifecycle and it returns content using PortletRequestDispatcher.include(). The jsf-portlet window displays the same content which was shown on portlet window before clicking on other tab.

Click on the Finish button of the edit page of some other channel, thereby causing a refresh of the portal page containing the JSF portlet  

The render() method of JSF Portlet is called which calls the render method of JSF Lifecycle and it returns content using PortletRequestDispatcher.include(). Therefore, the jsf-portlet window displays the same content which was shown on portlet window before clicking the edit button.

Execute any action on some other channel, thereby causing the portal page containing JSF portlet to be refreshed 

The render() method of JSF Portlet is called which calls the render method of JSF Lifecycle and it returns content using PortletRequestDispatcher.include(). The jsf-portlet window displays the same content which was shown on portlet window before executing any action on some other channel.