deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject deltaspike git commit: DELTASPIKE-947 StackOverFlow with DELEGATED window mode and undefined javax.faces.CLIENT_WINDOW_MODE
Date Wed, 08 Jul 2015 16:24:20 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 203a0dac4 -> 32e09a540


DELTASPIKE-947 StackOverFlow with DELEGATED window mode and undefined javax.faces.CLIENT_WINDOW_MODE

Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/32e09a54
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/32e09a54
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/32e09a54

Branch: refs/heads/master
Commit: 32e09a5400ef24b2b917a0118b2087356ea01b44
Parents: 203a0da
Author: Thomas Andraschko <tandraschko@apache.org>
Authored: Wed Jul 8 18:24:10 2015 +0200
Committer: Thomas Andraschko <tandraschko@apache.org>
Committed: Wed Jul 8 18:24:10 2015 +0200

----------------------------------------------------------------------
 .../JsfClientWindowAwareLifecycleWrapper.java   | 21 +++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/32e09a54/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/request/JsfClientWindowAwareLifecycleWrapper.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/request/JsfClientWindowAwareLifecycleWrapper.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/request/JsfClientWindowAwareLifecycleWrapper.java
index a482f22..e4a5383 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/request/JsfClientWindowAwareLifecycleWrapper.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/request/JsfClientWindowAwareLifecycleWrapper.java
@@ -20,7 +20,6 @@ package org.apache.deltaspike.jsf.impl.listener.request;
 
 import org.apache.deltaspike.core.api.provider.BeanProvider;
 import org.apache.deltaspike.core.util.ExceptionUtils;
-import org.apache.deltaspike.jsf.api.config.JsfModuleConfig;
 import org.apache.deltaspike.jsf.impl.scope.window.ClientWindowAdapter;
 import org.apache.deltaspike.jsf.spi.scope.window.ClientWindow;
 import org.apache.deltaspike.jsf.spi.scope.window.ClientWindowConfig;
@@ -40,7 +39,7 @@ public class JsfClientWindowAwareLifecycleWrapper extends LifecycleWrapper
     private final Lifecycle wrapped;
 
     private volatile Boolean initialized;
-    private boolean delegateWindowHandling;
+    private ClientWindowConfig clientWindowConfig;
 
     public JsfClientWindowAwareLifecycleWrapper(Lifecycle wrapped)
     {
@@ -58,7 +57,10 @@ public class JsfClientWindowAwareLifecycleWrapper extends LifecycleWrapper
     {
         lazyInit();
 
-        if (this.delegateWindowHandling)
+        boolean delegateWindowHandling = ClientWindowConfig.ClientWindowRenderMode.DELEGATED.equals(
+                clientWindowConfig.getClientWindowRenderMode(facesContext));
+        
+        if (delegateWindowHandling)
         {
             try
             {
@@ -143,17 +145,19 @@ public class JsfClientWindowAwareLifecycleWrapper extends LifecycleWrapper
     }
 
     @Override
-    public void render(FacesContext context) throws FacesException
+    public void render(FacesContext facesContext) throws FacesException
     {
         lazyInit();
 
         // prevent jfwid rendering
-        if (!delegateWindowHandling && context.getExternalContext().getClientWindow()
!= null)
+        boolean delegateWindowHandling = ClientWindowConfig.ClientWindowRenderMode.DELEGATED.equals(
+                clientWindowConfig.getClientWindowRenderMode(facesContext));
+        if (!delegateWindowHandling && facesContext.getExternalContext().getClientWindow()
!= null)
         {
-            context.getExternalContext().getClientWindow().disableClientWindowRenderMode(context);
+            facesContext.getExternalContext().getClientWindow().disableClientWindowRenderMode(facesContext);
         }
         
-        super.render(context);
+        super.render(facesContext);
     }
     
     private void lazyInit()
@@ -169,8 +173,7 @@ public class JsfClientWindowAwareLifecycleWrapper extends LifecycleWrapper
         // switch into paranoia mode
         if (this.initialized == null)
         {
-            this.delegateWindowHandling = ClientWindowConfig.ClientWindowRenderMode.DELEGATED.equals(
-                BeanProvider.getContextualReference(JsfModuleConfig.class).getDefaultWindowMode());
+            this.clientWindowConfig = BeanProvider.getContextualReference(ClientWindowConfig.class);
 
             this.initialized = true;
         }


Mime
View raw message