myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jak...@apache.org
Subject svn commit: r939970 - in /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces: lifecycle/RestoreViewExecutor.java view/facelets/FaceletViewDeclarationLanguage.java
Date Sat, 01 May 2010 10:31:21 GMT
Author: jakobk
Date: Sat May  1 10:31:21 2010
New Revision: 939970

URL: http://svn.apache.org/viewvc?rev=939970&view=rev
Log:
MYFACES-2690 Do not create the view for a debug request

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java?rev=939970&r1=939969&r2=939970&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java
Sat May  1 10:31:21 2010
@@ -151,6 +151,12 @@ class RestoreViewExecutor implements Pha
                     {
                         viewParameters = metadata.getViewParameters(viewRoot);
                     }
+                    else if(facesContext.getResponseComplete())
+                    {
+                        // this can happen if the current request is a debug request,
+                        // in this case no further processing is necessary
+                        return true;
+                    }
                 }
     
                 // If viewParameters is not an empty collection DO NOT call renderResponse

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java?rev=939970&r1=939969&r2=939970&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
Sat May  1 10:31:21 2010
@@ -78,9 +78,9 @@ import javax.faces.view.StateManagementS
 import javax.faces.view.ValueHolderAttachedObjectHandler;
 import javax.faces.view.ValueHolderAttachedObjectTarget;
 import javax.faces.view.ViewMetadata;
-import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.TagDecorator;
+import javax.faces.view.facelets.FaceletContext;
 import javax.faces.view.facelets.ResourceResolver;
+import javax.faces.view.facelets.TagDecorator;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletResponse;
@@ -1199,8 +1199,18 @@ public class FaceletViewDeclarationLangu
     public UIViewRoot createView(FacesContext context, String viewId)
     {
         // we have to check for a possible debug request
-        UIDebug.debugRequest(context);
-        return super.createView(context, viewId);
+        if (UIDebug.debugRequest(context))
+        {
+            // the current request is a debug request, so we don't need
+            // to create a view, since the output has already been written
+            // in UIDebug.debugRequest() and facesContext.responseComplete()
+            // has been called.
+            return null;
+        }
+        else
+        {
+            return super.createView(context, viewId);
+        }
     }
 
     /**
@@ -2067,11 +2077,15 @@ public class FaceletViewDeclarationLangu
                 // the ViewHandler might be wrapped and wants to do some work
                 // in createView() (e.g. in Trinidad - see MYFACES-2641)
                 UIViewRoot view = context.getApplication().getViewHandler().createView(context,
getViewId());
-                // inside createView(context,viewId), calculateViewId() is called and
-                // the result is stored inside created UIViewRoot, so we can safely take
the derived
-                // viewId from there.
-                Facelet facelet = _getViewMetadataFacelet(view.getViewId());
-                facelet.apply(context, view);
+                
+                if (view != null)
+                {
+                    // inside createView(context,viewId), calculateViewId() is called and
+                    // the result is stored inside created UIViewRoot, so we can safely take
the derived
+                    // viewId from there.
+                    Facelet facelet = _getViewMetadataFacelet(view.getViewId());
+                    facelet.apply(context, view);
+                }
 
                 return view;
             }



Mime
View raw message