[ 
https://issues.apache.org/jira/browse/PB-78?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610624#action_12610624
 ] 

David Sean Taylor commented on PB-78:
-------------------------------------

I committed your patch. Please review and let me know if it works for you:

http://svn.apache.org/viewvc?view=rev&revision=674092

> FacesPortlet does not check view id if it is null before it calls to 
> restoreView in ActionRequest
> -------------------------------------------------------------------------------------------------
>
>                 Key: PB-78
>                 URL: https://issues.apache.org/jira/browse/PB-78
>             Project: Portals Bridges
>          Issue Type: Bug
>          Components: jsf
>    Affects Versions: 1.0.4
>         Environment: 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)
>            Reporter: Ali Omar
>            Assignee: David Sean Taylor
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to