Details
-
Bug
-
Status: In Progress
-
Major
-
Resolution: Unresolved
-
1.0.4
-
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.4 (portals-bridges-jsf-1.0.4.jar)
Description
When redirecting from one portlet page to another, the ActionRequest on the new page comes before the first RenderRequest. This causes the view root id to be null during the ActionRequest. Therefore we need to check the value of viewId is not null before we call restoreView.
// lin line 489 of jsf/FacesPortlet.java
if (actionRequest)
{
String vi = context.getViewRoot().getViewId();
if(vi != null) // THIS LINE INSERTED
context.getApplication().getViewHandler().restoreView(context, vi);
getLifecycle().execute(context);
if (log.isTraceEnabled())
// The view should have been restore.
// Pass it to the render request.
request.getPortletSession().setAttribute(
createViewRootKey(context, defaultPage, viewId),
context.getViewRoot());
ActionResponse actionResponse = (ActionResponse) response;
// save FacesMessage objects on session; so they can
// be restored during the render phase
saveFacesMessages(context, request.getPortletSession());
}
call to restoreView(context, null) during the actionRequest results in a NullPointerException.
This the original one that steve sent:
java.lang.NullPointerException
at com.sun.faces.application.ViewHandlerImpl.convertViewId(ViewHandlerImpl.java:879)
at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:280)
at org.apache.portals.bridges.jsf.PortletViewHandlerImpl.restoreView(PortletVi
Ali Omar