deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject git commit: DELTASPIKE-454 configurable initial redirect
Date Tue, 21 Jan 2014 08:16:28 GMT
Updated Branches:
  refs/heads/master b690a2af2 -> e5432a016


DELTASPIKE-454 configurable initial redirect


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

Branch: refs/heads/master
Commit: e5432a0166ce6a055dc7f88896d088f5744811de
Parents: b690a2a
Author: gpetracek <gpetracek@apache.org>
Authored: Tue Jan 21 09:12:58 2014 +0100
Committer: gpetracek <gpetracek@apache.org>
Committed: Tue Jan 21 09:14:31 2014 +0100

----------------------------------------------------------------------
 .../deltaspike/jsf/api/config/JsfModuleConfig.java |  2 +-
 .../jsf/impl/scope/window/DefaultClientWindow.java | 17 ++++++++++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e5432a01/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/JsfModuleConfig.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/JsfModuleConfig.java
b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/JsfModuleConfig.java
index dff9398..221cb21 100644
--- a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/JsfModuleConfig.java
+++ b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/JsfModuleConfig.java
@@ -47,7 +47,7 @@ public class JsfModuleConfig implements DeltaSpikeConfig
      */
     public boolean isInitialRedirectEnabled()
     {
-        return false; //TODO re-visit it
+        return true;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e5432a01/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/scope/window/DefaultClientWindow.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/scope/window/DefaultClientWindow.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/scope/window/DefaultClientWindow.java
index af577c3..1bad3f0 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/scope/window/DefaultClientWindow.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/scope/window/DefaultClientWindow.java
@@ -19,6 +19,7 @@
 package org.apache.deltaspike.jsf.impl.scope.window;
 
 import org.apache.deltaspike.core.spi.scope.window.WindowContext;
+import org.apache.deltaspike.jsf.api.config.JsfModuleConfig;
 import org.apache.deltaspike.jsf.impl.util.ClientWindowHelper;
 import org.apache.deltaspike.jsf.impl.util.JsfUtils;
 import org.apache.deltaspike.jsf.spi.scope.window.ClientWindow;
@@ -94,6 +95,9 @@ public class DefaultClientWindow implements ClientWindow
     private ClientWindowConfig clientWindowConfig;
 
     @Inject
+    private JsfModuleConfig jsfModuleConfig;
+
+    @Inject
     private WindowContext windowContext;
 
 
@@ -125,9 +129,16 @@ public class DefaultClientWindow implements ClientWindow
 
             if (StringUtils.isEmpty(windowId))
             {
-                ClientWindowHelper.handleInitialRedirect(facesContext, generateNewWindowId());
-                facesContext.responseComplete();
-                return null;
+                if (this.jsfModuleConfig.isInitialRedirectEnabled())
+                {
+                    ClientWindowHelper.handleInitialRedirect(facesContext, generateNewWindowId());
+                    facesContext.responseComplete();
+                    return null;
+                }
+                else
+                {
+                    return generateNewWindowId();
+                }
             }
 
             return windowId;


Mime
View raw message