Uploaded image for project: 'Portals Bridges (Retired)'
  1. Portals Bridges (Retired)
  2. PB-78

FacesPortlet does not check view id if it is null before it calls to restoreView in ActionRequest

    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • 1.0.4
    • None
    • jsf
    • 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())

      { log.trace("End Executing phases"); }

      // 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

      Attachments

        Activity

          People

            taylor David Sean Taylor
            omar Ali Omar
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified