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 2019/01/09 20:28:09 UTC

[myfaces] branch master updated: refactored

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9d142bc  refactored
9d142bc is described below

commit 9d142bcfd62460dc7221cfb5ad816512ae2c91e4
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Wed Jan 9 21:28:27 2019 +0100

    refactored
---
 .../org/apache/myfaces/config/MyfacesConfig.java   |  59 ++++++++-
 .../myfaces/renderkit/html/HtmlRenderKitImpl.java  |   3 +-
 .../renderkit/html/HtmlResponseStateManager.java   |  40 ++----
 .../myfaces/view/facelets/ViewPoolProcessor.java   |  22 ++--
 .../view/facelets/impl/DefaultFaceletContext.java  |   5 +-
 .../facelets/impl/FaceletCacheFactoryImpl.java     |  17 +--
 .../impl/FaceletCompositionContextImpl.java        | 134 +++------------------
 .../facelets/tag/jstl/core/ForEachHandler.java     |   8 +-
 .../html/HtmlResponseStateManagerTest.java         |  12 +-
 .../CacheELExpressionsAlwaysRecompileTestCase.java |   4 +-
 .../facelets/el/CacheELExpressionsTestCase.java    |   6 +-
 .../acid/AcidARCacheELMyFacesRequestTestCase.java  |   4 +-
 .../CompositeComponentNestedCCTestCase.java        |  18 +--
 .../tag/composite/CompositeComponentTestCase.java  |   4 +-
 .../facelets/tag/jstl/core/JstlCoreTestCase.java   |   8 +-
 .../facelets/tag/ui/ELExprTemplateTestCase.java    |   4 +-
 16 files changed, 138 insertions(+), 210 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/config/MyfacesConfig.java b/impl/src/main/java/org/apache/myfaces/config/MyfacesConfig.java
index bf2e0ac..c669f1c 100755
--- a/impl/src/main/java/org/apache/myfaces/config/MyfacesConfig.java
+++ b/impl/src/main/java/org/apache/myfaces/config/MyfacesConfig.java
@@ -29,6 +29,7 @@ import javax.faces.context.FacesContext;
 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFWebConfigParam;
 import org.apache.myfaces.util.ClassUtils;
 import org.apache.myfaces.util.StringUtils;
+import org.apache.myfaces.view.facelets.ELExpressionCacheMode;
 
 /**
  * Holds all configuration init parameters (from web.xml) that are independent
@@ -732,6 +733,44 @@ public class MyfacesConfig
     @JSFWebConfigParam(since = "2.0", alias = "facelets.RESOURCE_RESOLVER")
     public final static String RESOURCE_RESOLVER = "javax.faces.FACELETS_RESOURCE_RESOLVER";
     
+    /**
+     * Indicates if expressions generated by facelets should be cached or not.
+     * Default is noCache. There there are four modes:
+     * 
+     * <ul>
+     * <li>alwaysRecompile (since 2.1.12): Only does not cache when the expression contains
+     * a variable resolved using VariableMapper</li>
+     * <li>always: Only does not cache when expressions are inside user tags or the
+     * expression contains a variable resolved using VariableMapper</li>
+     * <li>allowCset: Like always, but does not allow cache when ui:param
+     * was used on the current template context</li>
+     * <li>strict: Like allowCset, but does not allow cache when c:set with
+     * var and value properties only is used on the current page context</li>
+     * <li>noCache: All expression are created each time the view is built</li>
+     * </ul>
+     * 
+     */
+    @JSFWebConfigParam(since="2.0.8", defaultValue="noCache",
+                       expectedValues="noCache, strict, allowCset, always, alwaysRecompile",
+                       group="EL", tags="performance")
+    public static final String CACHE_EL_EXPRESSIONS = "org.apache.myfaces.CACHE_EL_EXPRESSIONS";
+    
+    /**
+     * Wrap exception caused by calls to EL expressions, so information like
+     * the location, expression string and tag name can be retrieved by
+     * the ExceptionHandler implementation and used to output meaningful information about itself.
+     * 
+     * <p>Note in some cases this will wrap the original javax.el.ELException,
+     * so the information will not be on the stack trace unless ExceptionHandler
+     * retrieve checking if the exception implements ContextAware interface and calling getWrapped() method.
+     * </p>
+     * 
+     */
+    @JSFWebConfigParam(since="2.0.9, 2.1.3" , defaultValue="true", expectedValues="true, false")
+    public static final String WRAP_TAG_EXCEPTIONS_AS_CONTEXT_AWARE
+            = "org.apache.myfaces.WRAP_TAG_EXCEPTIONS_AS_CONTEXT_AWARE";
+    public static final boolean WRAP_TAG_EXCEPTIONS_AS_CONTEXT_AWARE_DEFAULT = true;
+    
     // we need it, applicationImpl not ready probably
     private ProjectStage projectStage = ProjectStage.Production;
     private boolean strictJsf2AllowSlashLibraryName;
@@ -807,6 +846,8 @@ public class MyfacesConfig
     private String[] viewSuffix = new String[] { ViewHandler.DEFAULT_SUFFIX };
     private String[] faceletsViewMappings = new String[] {};
     private String faceletsViewSuffix = ViewHandler.DEFAULT_FACELETS_SUFFIX;
+    private ELExpressionCacheMode elExpressionCacheMode;
+    private boolean wrapTagExceptionsAsContextAware = WRAP_TAG_EXCEPTIONS_AS_CONTEXT_AWARE_DEFAULT;
     
     
     private static final boolean MYFACES_IMPL_AVAILABLE;
@@ -1195,6 +1236,13 @@ public class MyfacesConfig
         cfg.faceletsViewSuffix = getString(extCtx, ViewHandler.FACELETS_SUFFIX_PARAM_NAME,
                 ViewHandler.DEFAULT_FACELETS_SUFFIX);
         
+        String elExpressionCacheMode = getString(extCtx, CACHE_EL_EXPRESSIONS,
+                ELExpressionCacheMode.noCache.name());    
+        cfg.elExpressionCacheMode = Enum.valueOf(ELExpressionCacheMode.class, elExpressionCacheMode); 
+ 
+        cfg.wrapTagExceptionsAsContextAware = getBoolean(extCtx, WRAP_TAG_EXCEPTIONS_AS_CONTEXT_AWARE,
+                WRAP_TAG_EXCEPTIONS_AS_CONTEXT_AWARE_DEFAULT);
+        
         return cfg;
     }
 
@@ -1635,6 +1683,15 @@ public class MyfacesConfig
         return viewIdDeriveCacheEnabled;
     }
 
-    
+    public ELExpressionCacheMode getELExpressionCacheMode()
+    {
+        return elExpressionCacheMode;
+    }
+
+    public boolean isWrapTagExceptionsAsContextAware()
+    {
+        return wrapTagExceptionsAsContextAware;
+    }
+
 }
 
diff --git a/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlRenderKitImpl.java b/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlRenderKitImpl.java
index 793a8b7..b56466e 100755
--- a/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlRenderKitImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlRenderKitImpl.java
@@ -61,6 +61,7 @@ public class HtmlRenderKitImpl extends RenderKit implements LazyRenderKit
     private Map<String, Map<String, Renderer>> _renderers;
     private ResponseStateManager _responseStateManager;
     private Map<String, ClientBehaviorRenderer> _clientBehaviorRenderers;
+    private MyfacesConfig myfacesConfig;
     
     // ~ Constructors -------------------------------------------------------------------------------
 
@@ -69,6 +70,7 @@ public class HtmlRenderKitImpl extends RenderKit implements LazyRenderKit
         _renderers = new ConcurrentHashMap<>(64, 0.75f, 1);
         _responseStateManager = new HtmlResponseStateManager();
         _clientBehaviorRenderers = new HashMap<>();
+        myfacesConfig = MyfacesConfig.getCurrentInstance(FacesContext.getCurrentInstance());
     }
 
     // ~ Methods ------------------------------------------------------------------------------------
@@ -219,7 +221,6 @@ public class HtmlRenderKitImpl extends RenderKit implements LazyRenderKit
     public ResponseWriter createResponseWriter(Writer writer, String contentTypeListString, String characterEncoding)
     {
         FacesContext facesContext = FacesContext.getCurrentInstance();
-        MyfacesConfig myfacesConfig = MyfacesConfig.getCurrentInstance(facesContext);
         String selectedContentType = null;
         String writerContentType = null;
         boolean isAjaxRequest = facesContext.getPartialViewContext().isAjaxRequest();
diff --git a/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java b/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
index 3600f86..1bcefef 100755
--- a/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
+++ b/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
@@ -22,7 +22,6 @@ import java.io.IOException;
 import java.util.Map;
 import java.util.logging.Logger;
 
-import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
 import javax.faces.context.ResponseWriter;
 import javax.faces.lifecycle.ClientWindow;
@@ -49,12 +48,17 @@ public class HtmlResponseStateManager extends MyfacesResponseStateManager
     
     private static final String SESSION_TOKEN = "oam.rsm.SESSION_TOKEN";
 
-    private StateCacheProvider _stateCacheFactory;
-    private Boolean _autoCompleteOffViewState;
+    private StateCacheProvider stateCacheFactory;
+    private MyfacesConfig myfacesConfig;
     
     public HtmlResponseStateManager()
-    {
-        _autoCompleteOffViewState = null;
+    {        
+        FacesContext facesContext = FacesContext.getCurrentInstance();
+        myfacesConfig = MyfacesConfig.getCurrentInstance(facesContext.getExternalContext());
+        
+        stateCacheFactory = StateCacheProviderFactory
+                .getStateCacheProviderFactory(facesContext.getExternalContext())
+                .getStateCacheProvider(facesContext.getExternalContext());
     }
     
     @Override
@@ -108,8 +112,6 @@ public class HtmlResponseStateManager extends MyfacesResponseStateManager
     {
         String serializedState = getStateCache(facesContext).getStateTokenProcessor(facesContext)
                 .encode(facesContext, savedState);
-        ExternalContext extContext = facesContext.getExternalContext();
-        MyfacesConfig myfacesConfig = MyfacesConfig.getCurrentInstance(extContext);
 
         responseWriter.startElement(HTML.INPUT_ELEM, null);
         responseWriter.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_HIDDEN, null);
@@ -120,11 +122,11 @@ public class HtmlResponseStateManager extends MyfacesResponseStateManager
             // JSF 2.2 if javax.faces.ViewState is used as the id, in portlet
             // case it will be duplicate ids and that not xml friendly.
             responseWriter.writeAttribute(HTML.ID_ATTR,
-                HtmlResponseStateManager.generateUpdateViewStateId(
-                    facesContext), null);
+                HtmlResponseStateManager.generateUpdateViewStateId(facesContext),
+                null);
         }
         responseWriter.writeAttribute(HTML.VALUE_ATTR, serializedState, null);
-        if (this.isAutocompleteOffViewState(facesContext))
+        if (myfacesConfig.isAutocompleteOffViewState())
         {
             responseWriter.writeAttribute(HTML.AUTOCOMPLETE_ATTR, "off", null);
         }
@@ -258,13 +260,7 @@ public class HtmlResponseStateManager extends MyfacesResponseStateManager
 
     protected StateCache getStateCache(FacesContext facesContext)
     {
-        if (_stateCacheFactory == null)
-        {
-            _stateCacheFactory = StateCacheProviderFactory
-                    .getStateCacheProviderFactory(facesContext.getExternalContext())
-                    .getStateCacheProvider(facesContext.getExternalContext());
-        }
-        return _stateCacheFactory.getStateCache(facesContext);
+        return stateCacheFactory.getStateCache(facesContext);
     }
 
     public static String generateUpdateClientWindowId(FacesContext facesContext)
@@ -322,14 +318,4 @@ public class HtmlResponseStateManager extends MyfacesResponseStateManager
         facesContext.getAttributes().put(VIEW_STATE_COUNTER, count);
         return id;
     }
-
-    private boolean isAutocompleteOffViewState(FacesContext facesContext)
-    {
-        if (_autoCompleteOffViewState == null)
-        {
-            _autoCompleteOffViewState = MyfacesConfig.getCurrentInstance(facesContext)
-                    .isAutocompleteOffViewState();
-        }
-        return _autoCompleteOffViewState;
-    }
 }
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java b/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java
index 33d5cf8..a17c267 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java
@@ -42,7 +42,6 @@ import org.apache.myfaces.context.RequestViewMetadata;
 import org.apache.myfaces.lifecycle.RestoreViewSupport;
 import org.apache.myfaces.config.MyfacesConfig;
 import org.apache.myfaces.util.WebConfigParamUtils;
-import org.apache.myfaces.view.facelets.impl.FaceletCompositionContextImpl;
 import org.apache.myfaces.view.facelets.pool.ViewPool;
 import org.apache.myfaces.view.facelets.pool.ViewPoolFactory;
 import org.apache.myfaces.view.facelets.pool.ViewEntry;
@@ -161,18 +160,19 @@ public class ViewPoolProcessor
     {
         if (context.isProjectStage(ProjectStage.Production))
         {
+            MyfacesConfig myfacesConfig = MyfacesConfig.getCurrentInstance(context);
+            
             boolean initialize = true;
-            String elMode = WebConfigParamUtils.getStringInitParameter(
-                        context.getExternalContext(),
-                        FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
-                            ELExpressionCacheMode.noCache.name());
-            if (!elMode.equals(ELExpressionCacheMode.alwaysRecompile.name()))
+
+            if (myfacesConfig.getELExpressionCacheMode() != ELExpressionCacheMode.alwaysRecompile)
             {
-                Logger.getLogger(ViewPoolProcessor.class.getName()).log(
-                    Level.INFO, FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS +
-                    " web config parameter is set to \"" + ( (elMode == null) ? "none" : elMode) +
-                    "\". To enable view pooling this param"+
-                    " must be set to \"alwaysRecompile\". View Pooling disabled.");
+                Logger.getLogger(ViewPoolProcessor.class.getName()).log(Level.INFO,
+                        MyfacesConfig.CACHE_EL_EXPRESSIONS
+                                + " web config parameter is set to \""
+                                + ((myfacesConfig.getELExpressionCacheMode() == null)
+                                        ? "none" : myfacesConfig.getELExpressionCacheMode())
+                                + "\". To enable view pooling this param"
+                                + " must be set to \"alwaysRecompile\". View Pooling disabled.");
                 initialize = false;
             }
             
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletContext.java b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletContext.java
index f0d3575..cab5b72 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletContext.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletContext.java
@@ -97,8 +97,7 @@ final class DefaultFaceletContext extends AbstractFaceletContext
 
     private final List<PageContext> _isolatedPageContext;
     
-    public DefaultFaceletContext(DefaultFaceletContext ctx,
-            AbstractFacelet facelet, boolean ccWrap)
+    public DefaultFaceletContext(DefaultFaceletContext ctx, AbstractFacelet facelet, boolean ccWrap)
     {
         _ctx = ctx._ctx;
         _faces = ctx._faces;
@@ -195,7 +194,6 @@ final class DefaultFaceletContext extends AbstractFaceletContext
     @Override
     public void setVariableMapper(VariableMapper varMapper)
     {
-        // Assert.param("varMapper", varMapper);
         _varMapper = varMapper;
         _varMapperBase = (_varMapper instanceof VariableMapperBase) ? (VariableMapperBase) varMapper : null;
     }
@@ -206,7 +204,6 @@ final class DefaultFaceletContext extends AbstractFaceletContext
     @Override
     public void setFunctionMapper(FunctionMapper fnMapper)
     {
-        // Assert.param("fnMapper", fnMapper);
         _fnMapper = fnMapper;
     }
 
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCacheFactoryImpl.java b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCacheFactoryImpl.java
index f410771..f63f6da 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCacheFactoryImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCacheFactoryImpl.java
@@ -20,10 +20,10 @@ package org.apache.myfaces.view.facelets.impl;
 
 import javax.faces.application.ProjectStage;
 import javax.faces.application.ViewHandler;
-import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
 import javax.faces.view.facelets.FaceletCache;
 import javax.faces.view.facelets.FaceletCacheFactory;
+import org.apache.myfaces.config.MyfacesConfig;
 
 import org.apache.myfaces.util.WebConfigParamUtils;
 import org.apache.myfaces.view.facelets.ELExpressionCacheMode;
@@ -42,28 +42,23 @@ public class FaceletCacheFactoryImpl extends FaceletCacheFactory
     public FaceletCache getFaceletCache()
     {
         FacesContext context = FacesContext.getCurrentInstance();
-        ExternalContext eContext = context.getExternalContext();
-        // refresh period
+
         long refreshPeriod;
         if(context.isProjectStage(ProjectStage.Production))
         {
-            refreshPeriod = WebConfigParamUtils.getLongInitParameter(eContext,
+            refreshPeriod = WebConfigParamUtils.getLongInitParameter(context.getExternalContext(),
                     ViewHandler.FACELETS_REFRESH_PERIOD_PARAM_NAME,
                     FaceletViewDeclarationLanguage.DEFAULT_REFRESH_PERIOD_PRODUCTION);
         }
         else
         {
-            refreshPeriod = WebConfigParamUtils.getLongInitParameter(eContext,
+            refreshPeriod = WebConfigParamUtils.getLongInitParameter(context.getExternalContext(),
                     ViewHandler.FACELETS_REFRESH_PERIOD_PARAM_NAME,
                     FaceletViewDeclarationLanguage.DEFAULT_REFRESH_PERIOD);
         }
         
-        String elMode = WebConfigParamUtils.getStringInitParameter(
-                    context.getExternalContext(),
-                    FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
-                        ELExpressionCacheMode.noCache.name());
-        
-        if (ELExpressionCacheMode.alwaysRecompile.toString().equals(elMode))
+        MyfacesConfig myfacesConfig = MyfacesConfig.getCurrentInstance(context.getExternalContext());        
+        if (ELExpressionCacheMode.alwaysRecompile == myfacesConfig.getELExpressionCacheMode())
         {
             return new CacheELFaceletCacheImpl(refreshPeriod);
         }
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java
index eec3adc..3358750 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java
@@ -34,9 +34,7 @@ import javax.faces.context.FacesContext;
 import javax.faces.view.AttachedObjectHandler;
 import javax.faces.view.EditableValueHolderAttachedObjectHandler;
 
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFWebConfigParam;
 import org.apache.myfaces.config.MyfacesConfig;
-import org.apache.myfaces.util.WebConfigParamUtils;
 import org.apache.myfaces.view.facelets.ELExpressionCacheMode;
 import org.apache.myfaces.view.facelets.FaceletCompositionContext;
 import org.apache.myfaces.view.facelets.FaceletFactory;
@@ -50,43 +48,7 @@ import org.apache.myfaces.view.facelets.tag.jsf.ComponentSupport;
  */
 public class FaceletCompositionContextImpl extends FaceletCompositionContext
 {
-    /**
-     * Indicates if expressions generated by facelets should be cached or not.
-     * Default is noCache. There there are four modes:
-     * 
-     * <ul>
-     * <li>alwaysRecompile (since 2.1.12): Only does not cache when the expression contains
-     * a variable resolved using VariableMapper</li>
-     * <li>always: Only does not cache when expressions are inside user tags or the
-     * expression contains a variable resolved using VariableMapper</li>
-     * <li>allowCset: Like always, but does not allow cache when ui:param
-     * was used on the current template context</li>
-     * <li>strict: Like allowCset, but does not allow cache when c:set with
-     * var and value properties only is used on the current page context</li>
-     * <li>noCache: All expression are created each time the view is built</li>
-     * </ul>
-     * 
-     */
-    @JSFWebConfigParam(since="2.0.8", defaultValue="noCache",
-                       expectedValues="noCache, strict, allowCset, always, alwaysRecompile",
-                       group="EL", tags="performance")
-    public static final String INIT_PARAM_CACHE_EL_EXPRESSIONS = "org.apache.myfaces.CACHE_EL_EXPRESSIONS";
-    
-    /**
-     * Wrap exception caused by calls to EL expressions, so information like
-     * the location, expression string and tag name can be retrieved by
-     * the ExceptionHandler implementation and used to output meaningful information about itself.
-     * 
-     * <p>Note in some cases this will wrap the original javax.el.ELException,
-     * so the information will not be on the stack trace unless ExceptionHandler
-     * retrieve checking if the exception implements ContextAware interface and calling getWrapped() method.
-     * </p>
-     * 
-     */
-    @JSFWebConfigParam(since="2.0.9, 2.1.3" , defaultValue="true", expectedValues="true, false")
-    public static final String INIT_PARAM_WRAP_TAG_EXCEPTIONS_AS_CONTEXT_AWARE
-            = "org.apache.myfaces.WRAP_TAG_EXCEPTIONS_AS_CONTEXT_AWARE";
-    
+
     private static final String JAVAX_FACES_LOCATION_PREFIX = "javax_faces_location_";
     
     private FacesContext _facesContext;
@@ -106,14 +68,8 @@ public class FaceletCompositionContextImpl extends FaceletCompositionContext
     private Boolean _isBuildingViewMetadata;
     
     private Boolean _refreshTransientBuildOnPSS;
-    
-    private Boolean _refreshTransientBuildOnPSSPreserveState;
-    
+        
     private Boolean _usingPSSOnThisView;
-    
-    private ELExpressionCacheMode _elExpressionCacheMode;
-    
-    private Boolean _isWrapTagExceptionsAsContextAware;
 
     private List<Map<String, UIComponent>> _componentsMarkedForDeletion;
     
@@ -159,6 +115,7 @@ public class FaceletCompositionContextImpl extends FaceletCompositionContext
     
     private VisitContextFactory _visitContextFactory = null;
     private UIViewRoot _viewRoot = null;
+    private MyfacesConfig myfacesConfig;
     
     public FaceletCompositionContextImpl(FaceletFactory factory, FacesContext facesContext)
     {
@@ -170,15 +127,15 @@ public class FaceletCompositionContextImpl extends FaceletCompositionContext
         _deletionLevel = -1;
         _sectionUniqueIdCounter = new SectionUniqueIdCounter();
         //Cached at facelet view
-        MyfacesConfig myfacesConfig = MyfacesConfig.getCurrentInstance(facesContext);
+        myfacesConfig = MyfacesConfig.getCurrentInstance(facesContext);
+
         if (myfacesConfig.getComponentUniqueIdsCacheSize() > 0)
         {
-            String[] componentIdsCache = (String [])facesContext.getExternalContext().
+            String[] componentIdsCache = (String[]) facesContext.getExternalContext().
                     getApplicationMap().get(FaceletViewDeclarationLanguage.CACHED_COMPONENT_IDS);
             if (componentIdsCache != null)
             {
-                _sectionUniqueComponentIdCounter = new SectionUniqueIdCounter("_", 
-                        componentIdsCache);
+                _sectionUniqueComponentIdCounter = new SectionUniqueIdCounter("_", componentIdsCache);
             }
             else
             {
@@ -414,8 +371,7 @@ public class FaceletCompositionContextImpl extends FaceletCompositionContext
     {
         if (_isRefreshingTransientBuild == null)
         {
-            _isRefreshingTransientBuild = FaceletViewDeclarationLanguage.
-                isRefreshingTransientBuild(_facesContext);
+            _isRefreshingTransientBuild = FaceletViewDeclarationLanguage.isRefreshingTransientBuild(_facesContext);
         }
         return _isRefreshingTransientBuild;
     }
@@ -425,8 +381,7 @@ public class FaceletCompositionContextImpl extends FaceletCompositionContext
     {
         if (_isMarkInitialState == null)
         {
-            _isMarkInitialState = FaceletViewDeclarationLanguage.
-                isMarkInitialState(_facesContext);
+            _isMarkInitialState = FaceletViewDeclarationLanguage.isMarkInitialState(_facesContext);
         }
         return _isMarkInitialState;
     }
@@ -451,12 +406,7 @@ public class FaceletCompositionContextImpl extends FaceletCompositionContext
     @Override
     public boolean isRefreshTransientBuildOnPSSPreserveState()
     {
-        if (_refreshTransientBuildOnPSSPreserveState == null)
-        {
-            _refreshTransientBuildOnPSSPreserveState = MyfacesConfig.getCurrentInstance(
-                    _facesContext).isRefreshTransientBuildOnPSSPreserveState();
-        }
-        return _refreshTransientBuildOnPSSPreserveState;
+        return myfacesConfig.isRefreshTransientBuildOnPSSPreserveState();
     }
     
     @Override
@@ -464,8 +414,7 @@ public class FaceletCompositionContextImpl extends FaceletCompositionContext
     {
         if (_isBuildingViewMetadata == null)
         {
-            _isBuildingViewMetadata = FaceletViewDeclarationLanguage.
-                    isBuildingViewMetadata(_facesContext);
+            _isBuildingViewMetadata = FaceletViewDeclarationLanguage.isBuildingViewMetadata(_facesContext);
         }
         return _isBuildingViewMetadata;
     }
@@ -475,8 +424,7 @@ public class FaceletCompositionContextImpl extends FaceletCompositionContext
     {
         if (_usingPSSOnThisView == null)
         {
-            _usingPSSOnThisView = FaceletViewDeclarationLanguage.
-                isUsingPSSOnThisView(_facesContext);
+            _usingPSSOnThisView = FaceletViewDeclarationLanguage.isUsingPSSOnThisView(_facesContext);
         }
         return _usingPSSOnThisView;
     }
@@ -490,27 +438,13 @@ public class FaceletCompositionContextImpl extends FaceletCompositionContext
     @Override
     public ELExpressionCacheMode getELExpressionCacheMode()
     {
-        if (_elExpressionCacheMode == null)
-        {
-            String value = WebConfigParamUtils.getStringInitParameter(
-                    _facesContext.getExternalContext(),
-                    INIT_PARAM_CACHE_EL_EXPRESSIONS, ELExpressionCacheMode.noCache.name());
-            
-            _elExpressionCacheMode = Enum.valueOf(ELExpressionCacheMode.class, value); 
-        }
-        return _elExpressionCacheMode;
+        return myfacesConfig.getELExpressionCacheMode();
     }
 
     @Override
     public boolean isWrapTagExceptionsAsContextAware()
     {
-        if (_isWrapTagExceptionsAsContextAware == null)
-        {
-            _isWrapTagExceptionsAsContextAware
-                    = WebConfigParamUtils.getBooleanInitParameter(_facesContext.getExternalContext(),
-                    INIT_PARAM_WRAP_TAG_EXCEPTIONS_AS_CONTEXT_AWARE, true);
-        }
-        return _isWrapTagExceptionsAsContextAware;
+        return myfacesConfig.isWrapTagExceptionsAsContextAware();
     }
 
     @Override
@@ -1156,46 +1090,6 @@ public class FaceletCompositionContextImpl extends FaceletCompositionContext
         return _visitContextFactory;
     }
     
-    private static class KeyEntryIterator<K, V> implements Iterator<K>
-    {
-        private Iterator<Map.Entry<K, V>> _delegateIterator;
-        
-        public KeyEntryIterator(Iterator<Map.Entry<K, V>> delegate)
-        {
-            _delegateIterator = delegate;
-        }
-        
-        @Override
-        public boolean hasNext()
-        {
-            if (_delegateIterator != null)
-            {
-                return _delegateIterator.hasNext();
-            }
-            return false;
-        }
-
-        @Override
-        public K next()
-        {
-            if (_delegateIterator != null)
-            {
-                return _delegateIterator.next().getKey();
-            }
-            return null;
-        }
-
-        @Override
-        public void remove()
-        {
-            if (_delegateIterator != null)
-            {
-                _delegateIterator.remove();
-            }
-        }
-        
-    }
-    
     private static class SimpleEntry<K, V> implements Map.Entry<K, V>
     {
         private final K _key;
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jstl/core/ForEachHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jstl/core/ForEachHandler.java
index bc69d02..e002783 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jstl/core/ForEachHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jstl/core/ForEachHandler.java
@@ -544,8 +544,7 @@ public final class ForEachHandler extends TagHandler implements ComponentContain
 
                     if (value instanceof Serializable)
                     {
-                        iterationState.getValueList().add(
-                            new Object[]{base, value, i});
+                        iterationState.getValueList().add(new Object[] {base, value, i});
                     }
 
                     try
@@ -568,15 +567,14 @@ public final class ForEachHandler extends TagHandler implements ComponentContain
                                 }
                                 else
                                 {
-                                    ve = ctx.getExpressionFactory().createValueExpression(
-                                                itrS, Object.class);
+                                    ve = ctx.getExpressionFactory().createValueExpression(itrS, Object.class);
                                 }
                             }
                             else
                             {
                                 ve = new IterationStatusExpression(itrS);
                             }
-                            setVar(ctx, parent, uniqueId, base+"_vs", vs, ve, srcVE);
+                            setVar(ctx, parent, uniqueId, base + "_vs", vs, ve, srcVE);
                         }
                         //setVarStatus(ctx, pctx, t, sO, eO, mO, srcVE, value, vs, first, !itr.hasNext(), i);
 
diff --git a/impl/src/test/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseStateManagerTest.java b/impl/src/test/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseStateManagerTest.java
index b8a98a5..9696bdb 100644
--- a/impl/src/test/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseStateManagerTest.java
+++ b/impl/src/test/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseStateManagerTest.java
@@ -32,10 +32,11 @@ public class HtmlResponseStateManagerTest extends FacesTestCase
     @Test
     public void testIsPostback()
     {
-        HtmlResponseStateManager hrsm = Mockito.spy(HtmlResponseStateManager.class);
-        
         Mockito.when(_facesContext.getExternalContext()).thenReturn(_externalContext);
+        Mockito.when(_externalContext.getApplicationMap()).thenReturn(new HashMap<>());
         
+        HtmlResponseStateManager hrsm = Mockito.spy(HtmlResponseStateManager.class);
+
         Map<String, String> map = new HashMap<>();
         map.put(ResponseStateManager.VIEW_STATE_PARAM, "seomthing");
         Mockito.when(_externalContext.getRequestParameterMap()).thenReturn(map);
@@ -46,12 +47,11 @@ public class HtmlResponseStateManagerTest extends FacesTestCase
     @Test
     public void testIsNoPostback()
     {
-        HtmlResponseStateManager hrsm = Mockito.spy(HtmlResponseStateManager.class);
-        
         Mockito.when(_facesContext.getExternalContext()).thenReturn(_externalContext);
+        Mockito.when(_externalContext.getApplicationMap()).thenReturn(new HashMap<>());
+        Mockito.when(_externalContext.getRequestParameterMap()).thenReturn(new HashMap<>());
         
-        Map<String, String> map = new HashMap<>();
-        Mockito.when(_externalContext.getRequestParameterMap()).thenReturn(map);
+        HtmlResponseStateManager hrsm = Mockito.spy(HtmlResponseStateManager.class);
 
         assertEquals(false, hrsm.isPostback(_facesContext));
     }
diff --git a/impl/src/test/java/org/apache/myfaces/view/facelets/el/CacheELExpressionsAlwaysRecompileTestCase.java b/impl/src/test/java/org/apache/myfaces/view/facelets/el/CacheELExpressionsAlwaysRecompileTestCase.java
index 22174d9..9fa48fb 100644
--- a/impl/src/test/java/org/apache/myfaces/view/facelets/el/CacheELExpressionsAlwaysRecompileTestCase.java
+++ b/impl/src/test/java/org/apache/myfaces/view/facelets/el/CacheELExpressionsAlwaysRecompileTestCase.java
@@ -22,10 +22,10 @@ import java.io.StringWriter;
 import javax.el.ExpressionFactory;
 import javax.faces.application.ViewHandler;
 import javax.faces.component.UIViewRoot;
+import org.apache.myfaces.config.MyfacesConfig;
 import org.apache.myfaces.test.mock.MockResponseWriter;
 import org.apache.myfaces.view.facelets.ELExpressionCacheMode;
 import org.apache.myfaces.view.facelets.FaceletTestCase;
-import org.apache.myfaces.view.facelets.impl.FaceletCompositionContextImpl;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -39,7 +39,7 @@ public class CacheELExpressionsAlwaysRecompileTestCase extends FaceletTestCase
     protected void setUpServletObjects() throws Exception
     {
         super.setUpServletObjects();
-        servletContext.addInitParameter(FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS,
+        servletContext.addInitParameter(MyfacesConfig.CACHE_EL_EXPRESSIONS,
             ELExpressionCacheMode.alwaysRecompile.toString());
         servletContext.addInitParameter(ViewHandler.FACELETS_SKIP_COMMENTS_PARAM_NAME, "true");
         servletContext.addInitParameter(ViewHandler.FACELETS_LIBRARIES_PARAM_NAME, "/user.taglib.xml");
diff --git a/impl/src/test/java/org/apache/myfaces/view/facelets/el/CacheELExpressionsTestCase.java b/impl/src/test/java/org/apache/myfaces/view/facelets/el/CacheELExpressionsTestCase.java
index 8b2a25c..7149e2f 100644
--- a/impl/src/test/java/org/apache/myfaces/view/facelets/el/CacheELExpressionsTestCase.java
+++ b/impl/src/test/java/org/apache/myfaces/view/facelets/el/CacheELExpressionsTestCase.java
@@ -21,10 +21,10 @@ package org.apache.myfaces.view.facelets.el;
 import java.io.StringWriter;
 import javax.el.ExpressionFactory;
 import javax.faces.component.UIViewRoot;
+import org.apache.myfaces.config.MyfacesConfig;
 import org.apache.myfaces.test.mock.MockResponseWriter;
 import org.apache.myfaces.view.facelets.ELExpressionCacheMode;
 import org.apache.myfaces.view.facelets.FaceletTestCase;
-import org.apache.myfaces.view.facelets.impl.FaceletCompositionContextImpl;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -44,7 +44,7 @@ public class CacheELExpressionsTestCase extends FaceletTestCase
     public void testUIParamCaching1() throws Exception
     {
         // Works in "none", "allowCset", and "strict" but it does not in always.
-        servletContext.addInitParameter(FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
+        servletContext.addInitParameter(MyfacesConfig.CACHE_EL_EXPRESSIONS, 
                 ELExpressionCacheMode.allowCset.toString());
         
         UIViewRoot root = facesContext.getViewRoot();
@@ -66,7 +66,7 @@ public class CacheELExpressionsTestCase extends FaceletTestCase
     public void testUIParamCaching2() throws Exception
     {
         // Works in "none", "allowCset", and "strict" but it does not in always.
-        servletContext.addInitParameter(FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
+        servletContext.addInitParameter(MyfacesConfig.CACHE_EL_EXPRESSIONS, 
                 ELExpressionCacheMode.strict.toString());
         
         UIViewRoot root = facesContext.getViewRoot();
diff --git a/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/AcidARCacheELMyFacesRequestTestCase.java b/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/AcidARCacheELMyFacesRequestTestCase.java
index c8d8c92..a1cdb95 100644
--- a/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/AcidARCacheELMyFacesRequestTestCase.java
+++ b/impl/src/test/java/org/apache/myfaces/view/facelets/pss/acid/AcidARCacheELMyFacesRequestTestCase.java
@@ -18,7 +18,7 @@
  */
 package org.apache.myfaces.view.facelets.pss.acid;
 
-import org.apache.myfaces.view.facelets.impl.FaceletCompositionContextImpl;
+import org.apache.myfaces.config.MyfacesConfig;
 
 public class AcidARCacheELMyFacesRequestTestCase extends AcidMyFacesRequestTestCase
 {
@@ -27,7 +27,7 @@ public class AcidARCacheELMyFacesRequestTestCase extends AcidMyFacesRequestTestC
     protected void setUpWebConfigParams() throws Exception
     {
         super.setUpWebConfigParams();
-        servletContext.addInitParameter(FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
+        servletContext.addInitParameter(MyfacesConfig.CACHE_EL_EXPRESSIONS, 
                 "alwaysRecompile");
     }
     
diff --git a/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentNestedCCTestCase.java b/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentNestedCCTestCase.java
index 80e9293..12990d7 100644
--- a/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentNestedCCTestCase.java
+++ b/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentNestedCCTestCase.java
@@ -24,11 +24,11 @@ import java.io.StringWriter;
 import javax.el.ExpressionFactory;
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIViewRoot;
+import org.apache.myfaces.config.MyfacesConfig;
 
 import org.apache.myfaces.test.mock.MockResponseWriter;
 import org.apache.myfaces.view.facelets.ELExpressionCacheMode;
 import org.apache.myfaces.view.facelets.FaceletTestCase;
-import org.apache.myfaces.view.facelets.impl.FaceletCompositionContextImpl;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -76,7 +76,7 @@ public class CompositeComponentNestedCCTestCase extends FaceletTestCase
     @Test
     public void testCompositeNestedCC1Cache() throws Exception
     {
-        servletContext.addInitParameter(FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
+        servletContext.addInitParameter(MyfacesConfig.CACHE_EL_EXPRESSIONS, 
                 ELExpressionCacheMode.always.toString());
         UIViewRoot root = facesContext.getViewRoot();
         vdl.buildView(facesContext, root, "testCompositeNestedCC1.xhtml");
@@ -129,7 +129,7 @@ public class CompositeComponentNestedCCTestCase extends FaceletTestCase
     @Test
     public void testCompositeNestedCC2Cache() throws Exception
     {
-        servletContext.addInitParameter(FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
+        servletContext.addInitParameter(MyfacesConfig.CACHE_EL_EXPRESSIONS, 
                 ELExpressionCacheMode.always.toString());
         UIViewRoot root = facesContext.getViewRoot();
         vdl.buildView(facesContext, root, "testCompositeNestedCC2.xhtml");
@@ -187,7 +187,7 @@ public class CompositeComponentNestedCCTestCase extends FaceletTestCase
     @Test
     public void testCompositeNestedCC3Cache() throws Exception
     {
-        servletContext.addInitParameter(FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
+        servletContext.addInitParameter(MyfacesConfig.CACHE_EL_EXPRESSIONS, 
                 ELExpressionCacheMode.always.toString()); //allowCset
         
         UIViewRoot root = facesContext.getViewRoot();
@@ -242,7 +242,7 @@ public class CompositeComponentNestedCCTestCase extends FaceletTestCase
     @Test
     public void testCompositeNestedCC4Cache() throws Exception
     {
-        servletContext.addInitParameter(FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
+        servletContext.addInitParameter(MyfacesConfig.CACHE_EL_EXPRESSIONS, 
                 ELExpressionCacheMode.always.toString());
 
         UIViewRoot root = facesContext.getViewRoot();
@@ -292,7 +292,7 @@ public class CompositeComponentNestedCCTestCase extends FaceletTestCase
     @Test
     public void testCompositeNestedCC5Cache() throws Exception
     {
-        servletContext.addInitParameter(FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
+        servletContext.addInitParameter(MyfacesConfig.CACHE_EL_EXPRESSIONS, 
                 ELExpressionCacheMode.always.toString());
         UIViewRoot root = facesContext.getViewRoot();
         vdl.buildView(facesContext, root, "testCompositeNestedCC5.xhtml");
@@ -345,7 +345,7 @@ public class CompositeComponentNestedCCTestCase extends FaceletTestCase
     @Test
     public void testCompositeNestedCC6Cache() throws Exception
     {
-        servletContext.addInitParameter(FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
+        servletContext.addInitParameter(MyfacesConfig.CACHE_EL_EXPRESSIONS, 
                 ELExpressionCacheMode.always.toString());
         UIViewRoot root = facesContext.getViewRoot();
         vdl.buildView(facesContext, root, "testCompositeNestedCC6.xhtml");
@@ -403,7 +403,7 @@ public class CompositeComponentNestedCCTestCase extends FaceletTestCase
     @Test
     public void testCompositeNestedCC7Cache() throws Exception
     {
-        servletContext.addInitParameter(FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
+        servletContext.addInitParameter(MyfacesConfig.CACHE_EL_EXPRESSIONS, 
                 ELExpressionCacheMode.always.toString()); //allowCset
         
         UIViewRoot root = facesContext.getViewRoot();
@@ -458,7 +458,7 @@ public class CompositeComponentNestedCCTestCase extends FaceletTestCase
     @Test
     public void testCompositeNestedCC8Cache() throws Exception
     {
-        servletContext.addInitParameter(FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
+        servletContext.addInitParameter(MyfacesConfig.CACHE_EL_EXPRESSIONS, 
                 ELExpressionCacheMode.always.toString());
 
         UIViewRoot root = facesContext.getViewRoot();
diff --git a/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentTestCase.java b/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentTestCase.java
index 2a4c26b..0f5d0f0 100644
--- a/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentTestCase.java
+++ b/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentTestCase.java
@@ -35,6 +35,7 @@ import javax.faces.component.html.HtmlGraphicImage;
 import javax.faces.component.html.HtmlOutputText;
 import javax.faces.event.PostRenderViewEvent;
 import javax.faces.event.PreRenderViewEvent;
+import org.apache.myfaces.config.MyfacesConfig;
 
 import org.apache.myfaces.config.NamedEventManager;
 import org.apache.myfaces.config.RuntimeConfig;
@@ -43,7 +44,6 @@ import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
 import org.apache.myfaces.test.utils.HtmlRenderedAttr;
 import org.apache.myfaces.view.facelets.FaceletTestCase;
 import org.apache.myfaces.view.facelets.bean.HelloWorld;
-import org.apache.myfaces.view.facelets.impl.FaceletCompositionContextImpl;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -817,7 +817,7 @@ public class CompositeComponentTestCase extends FaceletTestCase
     public void testsCompositeRefVE() throws Exception {
         
         servletContext.addInitParameter(
-                FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
+                MyfacesConfig.CACHE_EL_EXPRESSIONS, 
                 "always");
         
         UIViewRoot root = facesContext.getViewRoot();
diff --git a/impl/src/test/java/org/apache/myfaces/view/facelets/tag/jstl/core/JstlCoreTestCase.java b/impl/src/test/java/org/apache/myfaces/view/facelets/tag/jstl/core/JstlCoreTestCase.java
index 5d891ac..b61b4ad 100644
--- a/impl/src/test/java/org/apache/myfaces/view/facelets/tag/jstl/core/JstlCoreTestCase.java
+++ b/impl/src/test/java/org/apache/myfaces/view/facelets/tag/jstl/core/JstlCoreTestCase.java
@@ -34,6 +34,7 @@ import javax.faces.component.html.HtmlForm;
 import javax.faces.component.html.HtmlInputText;
 import javax.faces.component.html.HtmlOutputText;
 import javax.faces.context.FacesContext;
+import org.apache.myfaces.config.MyfacesConfig;
 
 import org.apache.myfaces.renderkit.html.HtmlButtonRenderer;
 import org.apache.myfaces.renderkit.html.HtmlFormRenderer;
@@ -42,7 +43,6 @@ import org.apache.myfaces.test.mock.MockResponseWriter;
 import org.apache.myfaces.view.facelets.ELExpressionCacheMode;
 import org.apache.myfaces.view.facelets.FaceletTestCase;
 import org.apache.myfaces.view.facelets.bean.Employee;
-import org.apache.myfaces.view.facelets.impl.FaceletCompositionContextImpl;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -202,7 +202,7 @@ public final class JstlCoreTestCase extends FaceletTestCase {
     @Test
     public void testForEach2CacheAlways() throws Exception
     {
-        servletContext.addInitParameter(FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
+        servletContext.addInitParameter(MyfacesConfig.CACHE_EL_EXPRESSIONS, 
                 ELExpressionCacheMode.always.toString());
         testForEach2();
     }
@@ -249,7 +249,7 @@ public final class JstlCoreTestCase extends FaceletTestCase {
     @Test
     public void testForEach3CacheAlways() throws Exception
     {
-        servletContext.addInitParameter(FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
+        servletContext.addInitParameter(MyfacesConfig.CACHE_EL_EXPRESSIONS, 
                 ELExpressionCacheMode.always.toString());
         testForEach3();
     }
@@ -297,7 +297,7 @@ public final class JstlCoreTestCase extends FaceletTestCase {
     @Test
     public void testForEach4CacheAlways() throws Exception
     {
-        servletContext.addInitParameter(FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS, 
+        servletContext.addInitParameter(MyfacesConfig.CACHE_EL_EXPRESSIONS, 
                 ELExpressionCacheMode.always.toString());
         testForEach4();
     }
diff --git a/impl/src/test/java/org/apache/myfaces/view/facelets/tag/ui/ELExprTemplateTestCase.java b/impl/src/test/java/org/apache/myfaces/view/facelets/tag/ui/ELExprTemplateTestCase.java
index 8e4ed7d..86019f1 100644
--- a/impl/src/test/java/org/apache/myfaces/view/facelets/tag/ui/ELExprTemplateTestCase.java
+++ b/impl/src/test/java/org/apache/myfaces/view/facelets/tag/ui/ELExprTemplateTestCase.java
@@ -20,9 +20,9 @@
 package org.apache.myfaces.view.facelets.tag.ui;
 
 import javax.faces.component.UIViewRoot;
+import org.apache.myfaces.config.MyfacesConfig;
 
 import org.apache.myfaces.view.facelets.FaceletTestCase;
-import org.apache.myfaces.view.facelets.impl.FaceletCompositionContextImpl;
 import org.junit.Test;
 
 public class ELExprTemplateTestCase extends FaceletTestCase {
@@ -35,7 +35,7 @@ public class ELExprTemplateTestCase extends FaceletTestCase {
         super.setUpServletObjects();
         
         servletContext.addInitParameter(
-                FaceletCompositionContextImpl.INIT_PARAM_CACHE_EL_EXPRESSIONS,
+                MyfacesConfig.CACHE_EL_EXPRESSIONS,
                 "always");
     }