If you want to change a page without using a Faces action, you can set a JSP file path to the one of the following session attributes:
Session Attribute Name | Description |
---|---|
com.ibm.faces.portlet.page.view | The JSP file path for the View mode. |
com.ibm.faces.portlet.page.edit | The JSP file path for the Edit mode. |
com.ibm.faces.portlet.page.help | The JSP file path for the Help mode. |
com.ibm.faces.portlet.page.config | The JSP file path for the Configure mode. |
public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { if (...) { request.getPortletSession().setAttribute("com.ibm.faces.portlet.page.view", "/MyPage.jsp"); } super.doView(request, response); }
Note that the session attributes are only effective before the Faces lifecycle is started by the Faces portlet's methods, such as processAction(), or actionPerformed(), or doView(), etc. Once the Faces lifecycle starts and the Faces UI component tree is created, the session attributes are not read by the Faces portlet.