You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2020/04/25 16:24:33 UTC

[myfaces] branch 3.0.x updated: MYFACES-4333 ElContext#getFunctionMapper returns null

This is an automated email from the ASF dual-hosted git repository.

tandraschko pushed a commit to branch 3.0.x
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/3.0.x by this push:
     new 3a83e49  MYFACES-4333 ElContext#getFunctionMapper returns null
3a83e49 is described below

commit 3a83e49e2d5b6927a719412f9077d77dcf23d057
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Sat Apr 25 18:24:25 2020 +0200

    MYFACES-4333 ElContext#getFunctionMapper returns null
---
 .../myfaces/view/facelets/FaceletViewDeclarationLanguage.java      | 5 +++--
 .../apache/myfaces/view/facelets/compiler/NamespaceHandler.java    | 7 +++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java b/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
index 796f709..cb0bea4 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
@@ -2631,8 +2631,9 @@ public class FaceletViewDeclarationLanguage extends FaceletViewDeclarationLangua
         // Per spec section 11.1.3, the default value for the partial state saving feature needs
         // to be true if 2.0, false otherwise.
 
-        partialStateSavingDefault = "2.0".equals(facesVersion) || "2.1".equals(facesVersion) || 
-            "2.2".equals(facesVersion) || (facesVersion == null);
+        partialStateSavingDefault = "2.0".equals(facesVersion) || "2.1".equals(facesVersion)
+                || "2.2".equals(facesVersion) || "2.2".equals(facesVersion) || "3.0".equals(facesVersion)
+                || (facesVersion == null);
 
         // In jsf 2.0 this code evolve as PartialStateSaving feature
         //_buildBeforeRestore = _getBooleanParameter(context, PARAM_BUILD_BEFORE_RESTORE, false);
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/NamespaceHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/NamespaceHandler.java
index b1310d0..cb8eaa2 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/NamespaceHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/NamespaceHandler.java
@@ -30,6 +30,8 @@ import jakarta.faces.view.facelets.ComponentHandler;
 import jakarta.faces.view.facelets.FaceletContext;
 import jakarta.faces.view.facelets.FaceletException;
 import jakarta.faces.view.facelets.FaceletHandler;
+import javax.el.ELContext;
+import org.apache.myfaces.el.unified.FacesELContext;
 
 import org.apache.myfaces.view.facelets.el.CompositeFunctionMapper;
 import org.apache.myfaces.view.facelets.tag.TagLibrary;
@@ -53,6 +55,11 @@ final class NamespaceHandler extends FunctionMapper implements FaceletHandler
             ELException
     {
         FunctionMapper orig = ctx.getFunctionMapper();
+        ELContext elContext = ctx.getFacesContext().getELContext();
+        if (elContext instanceof FacesELContext)
+        {
+            ((FacesELContext) elContext).setFunctionMapper(this);
+        }
         ctx.setFunctionMapper(new CompositeFunctionMapper(this, orig));
         try
         {