[ 
https://issues.apache.org/jira/browse/MYFACES-2371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Leonardo Uribe resolved MYFACES-2371.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.2.8-SNAPSHOT
         Assignee: Leonardo Uribe

Thanks to Asuka Langley for note this issue

> NullPointerException on UIComponentClassicTagBase.getViewComponentIds() fixed 
> on branch  2.0.x but not on branch 1.2.x
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-2371
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2371
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.2.7
>            Reporter: Asuka Langley
>            Assignee: Leonardo Uribe
>             Fix For: 1.2.8-SNAPSHOT
>
>
> The problem occurs when the user wants to access to a .jsp page that includes 
> a <f:subview> tag.
> It seems to be a bug on UIComponentClassicTagBase.getViewComponentIds(). It 
> was fixed on 2.0.x branch but not on 1.2.x in this way:
> before:
>     private Map<String,Object> getViewComponentIds()
>     {
>         Map<String, Object> requestMap = 
> _facesContext.getExternalContext().getRequestMap();
>         Map<String, Object> viewComponentIds;
>         if (_parent == null)
>         {
>             // top level _componentInstance
>             viewComponentIds = new HashMap<String,Object>();
>             requestMap.put(VIEW_IDS, viewComponentIds);
>         }
>         else
>         {
>             viewComponentIds = (Map<String, Object>) requestMap.get(VIEW_IDS);
>         }
>         return viewComponentIds;
>     }
> After:
>     private Map<String, Object> getViewComponentIds()
>     {
>         Map<String, Object> requestMap = 
> _facesContext.getExternalContext().getRequestMap();
>         Map<String, Object> viewComponentIds;
>         if (_parent == null)
>         {
>             // top level _componentInstance
>             viewComponentIds = new HashMap<String, Object>();
>             requestMap.put(VIEW_IDS, viewComponentIds);
>         }
>         else
>         {
>             viewComponentIds = (Map<String, Object>)requestMap.get(VIEW_IDS);
>             
>             // Check if null, this can happen if someone programatically 
> tries to do an include of a 
>             // JSP fragment. This code will prevent NullPointerException from 
> happening in such cases.
>             if (viewComponentIds == null)
>             {
>                 viewComponentIds = new HashMap<String, Object>();
>                 requestMap.put(VIEW_IDS, viewComponentIds);
>             }
>         }
>         return viewComponentIds;
>     }

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

Reply via email to