You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2011/06/25 20:39:42 UTC

svn commit: r1139586 - /myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java

Author: lu4242
Date: Sat Jun 25 18:39:42 2011
New Revision: 1139586

URL: http://svn.apache.org/viewvc?rev=1139586&view=rev
Log:
MYFACES-3187 DebugPhaseListener shouldn't be active by default

Modified:
    myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java?rev=1139586&r1=1139585&r2=1139586&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java Sat Jun 25 18:39:42 2011
@@ -230,6 +230,14 @@ public class MyfacesConfig
     public final static String INIT_PARAM_RENDER_FORM_SUBMIT_SCRIPT_INLINE = "org.apache.myfaces.RENDER_FORM_SUBMIT_SCRIPT_INLINE";
     public final static boolean INIT_PARAM_RENDER_FORM_SUBMIT_SCRIPT_INLINE_DEFAULT = false;
     
+    /**
+     * Enable/disable DebugPhaseListener feature, with provide useful information about ValueHolder variables (submittedValue, localValue, value).
+     * Note evaluate those getters for each component could cause some unwanted side effects when using "access" type scopes like on MyFaces CODI.
+     * This param only has effect when project stage is Development.     
+     */
+    @JSFWebConfigParam(since="2.0.8")
+    public final static String INIT_PARAM_DEBUG_PHASE_LISTENER = "org.apache.myfaces.DEBUG_PHASE_LISTENER";
+    public final static boolean INIT_PARAM_DEBUG_PHASE_LISTENER_DEFAULT = false;
     
     private boolean _prettyHtml;
     private boolean _detectJavascript;
@@ -253,6 +261,7 @@ public class MyfacesConfig
     private boolean _validateXML;
     private boolean _wrapScriptContentWithXmlCommentTag;
     private boolean _renderFormSubmitScriptInline;
+    private boolean _debugPhaseListenerEnabled;
 
     private static final boolean TOMAHAWK_AVAILABLE;
     private static final boolean MYFACES_IMPL_AVAILABLE;
@@ -344,6 +353,7 @@ public class MyfacesConfig
         //tomahawk is on classpath and no test environment is set
         setCheckExtensionsFilter(false);
         setRenderFormSubmitScriptInline(INIT_PARAM_RENDER_FORM_SUBMIT_SCRIPT_INLINE_DEFAULT);
+        setDebugPhaseListenerEnabled(INIT_PARAM_DEBUG_PHASE_LISTENER_DEFAULT);
     }
 
     private static MyfacesConfig createAndInitializeMyFacesConfig(ExternalContext extCtx) {
@@ -415,6 +425,9 @@ public class MyfacesConfig
         
         myfacesConfig.setWrapScriptContentWithXmlCommentTag(getBooleanInitParameter(extCtx, 
                 INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG, INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG_DEFAULT));
+        
+        myfacesConfig.setDebugPhaseListenerEnabled(getBooleanInitParameter(extCtx, INIT_PARAM_DEBUG_PHASE_LISTENER,
+                INIT_PARAM_DEBUG_PHASE_LISTENER_DEFAULT));
 
         if (TOMAHAWK_AVAILABLE)
         {
@@ -820,4 +833,14 @@ public class MyfacesConfig
     {
         _renderFormSubmitScriptInline = renderFormSubmitScriptInline;
     }
+
+    public boolean isDebugPhaseListenerEnabled()
+    {
+        return _debugPhaseListenerEnabled;
+    }
+
+    public void setDebugPhaseListenerEnabled(boolean debugPhaseListener)
+    {
+        this._debugPhaseListenerEnabled = debugPhaseListener;
+    }
 }