myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1139582 - /myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
Date Sat, 25 Jun 2011 18:38:23 GMT
Author: lu4242
Date: Sat Jun 25 18:38:23 2011
New Revision: 1139582

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

Modified:
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java?rev=1139582&r1=1139581&r2=1139582&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
(original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
Sat Jun 25 18:38:23 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;
+    }
 }



Mime
View raw message