Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4333

ElContext#getFunctionMapper returns null

    XMLWordPrintableJSON

Details

    Description

      Hello,

      When retrieving the functionMapper from the ELContext, null is returned.

      FacesContext facesContext = FacesContext.getCurrentInstance(); ELContext elContext = facesContext.getELContext(); FunctionMapper functionMapper = elContext.getFunctionMapper()

       A sample application is also attached. It works with the reference implementation, but not with MyFaces.

       After looking over the code, I noticed that FacesELContext is not initialized with a default function mapper, and the FacesELContext#setFunctionMapper was never called. I addressed this by setFunctionMapper in the NamespaceHandler. Please let me know if you have any improvements to this fix. The behavior with my fix matches how the reference implementation behaves. 

       

      Additionally, this fix worked for version 2.2, but version 2.3 needed another change with the partialStateSavingDefault variable. I believe It's to false by accident when it's checked here: 

       

         partialStateSavingDefault = "2.0".equals(facesVersion) || "2.1".equals(facesVersion) || "2.2".equals(facesVersion) || (facesVersion == null);
      

       

      I wasn't sure whether to add "2.3".equals(facesVersion), but I thought it would be better to create a default state variable and keep it within the StateManager.  Please advice if this change should also be applied to 3.0 & master?

      Thank you

       

      Attachments

        1. JSF22-MyFaces-4333.patch
          2 kB
          Volodymyr Siedlecki
        2. JSF23-MyFaces-4333-Fix.patch
          5 kB
          Volodymyr Siedlecki
        3. MYFACES-4333.zip
          9 kB
          Volodymyr Siedlecki

        Activity

          People

            Unassigned Unassigned
            volosied Volodymyr Siedlecki
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: