Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0
-
None
-
None
-
Sun JSF Reference Implementation version 1.2 (jsf-impl.jar)
Websphere portlet container version 6.1.0
Apache MyFaces JSF portal bridge version 1.0 (portals-bridges-jsf-1.0.jar)
Description
The method: org.apache.portals.bridges.jsf.FacesPortlet.setDefaultView(FacesContext, String, String) contains an else branch that is entered when the viewRoot value is null (line 589).
This else branch creates a new viewRoot, a new view id, and sets both on the facesContext object. The code then creates a view root key and calls portal session set attribute with this key using the null viewRoot value, instead of the viewRoot object that was just created. The portlet session attribute map will contain a valid viewRoot key, but a null viewRoot value. This appears to be an error, because the viewRoot is always going to be null when this branch of code is entered.
I propose that the method call (on line 594 of FacesPortlet) should look like this:
portletRequest.getPortletSession().setAttribute(createViewRootKey(facesContext, view, viewId), facesContext.getViewRoot() );
This will store the newly created viewRoot in the portlet session where it can be retrieved.