You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by st...@apache.org on 2013/04/23 20:41:12 UTC

git commit: DELTASPIKE-289 exclude lifecycle execution if ClientWindow page gets rendered

Updated Branches:
  refs/heads/master aded57f8f -> 6dacff805


DELTASPIKE-289 exclude lifecycle execution if ClientWindow page gets rendered


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

Branch: refs/heads/master
Commit: 6dacff805964cca70c4f8ce0a2c3e65c946fca9e
Parents: aded57f
Author: Mark Struberg <st...@apache.org>
Authored: Tue Apr 23 20:39:35 2013 +0200
Committer: Mark Struberg <st...@apache.org>
Committed: Tue Apr 23 20:39:35 2013 +0200

----------------------------------------------------------------------
 .../WindowIdHolderComponentHtmlRenderer.java       |    2 +-
 .../request/DeltaSpikeLifecycleWrapper.java        |    5 +-
 .../META-INF/resources/deltaspike/windowhandler.js |  193 +++++++++++++++
 .../META-INF/resources/js/windowhandler.js         |  193 ---------------
 .../src/main/resources/static/windowhandler.html   |    2 +-
 .../impl/scope/window/WindowScopedContextTest.java |    7 +-
 .../window/beans/WindowScopedBackingBean.java      |    3 +-
 .../resources/windowScopedContextTest/page.xhtml   |    2 +
 .../resources/windowScopedContextTest/page2.xhtml  |   41 +++
 9 files changed, 248 insertions(+), 200 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6dacff80/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/component/window/WindowIdHolderComponentHtmlRenderer.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/component/window/WindowIdHolderComponentHtmlRenderer.java b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/component/window/WindowIdHolderComponentHtmlRenderer.java
index ff31933..89b8e7a 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/component/window/WindowIdHolderComponentHtmlRenderer.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/component/window/WindowIdHolderComponentHtmlRenderer.java
@@ -38,7 +38,7 @@ import org.apache.deltaspike.core.spi.scope.window.WindowContext;
 @FacesRenderer(componentFamily = WindowIdHolderComponent.COMPONENT_FAMILY,
         rendererType = WindowIdHolderComponent.COMPONENT_TYPE)
 @ResourceDependencies( {
-        @ResourceDependency(library = "js", name = "windowhandler.js", target = "head"),
+        @ResourceDependency(library = "deltaspike", name = "windowhandler.js", target = "head"),
         @ResourceDependency(library = "javax.faces", name = "jsf.js", target = "head") } )
 public class WindowIdHolderComponentHtmlRenderer extends Renderer
 {

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6dacff80/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/request/DeltaSpikeLifecycleWrapper.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/request/DeltaSpikeLifecycleWrapper.java b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/request/DeltaSpikeLifecycleWrapper.java
index 0f91b33..c9a0420 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/request/DeltaSpikeLifecycleWrapper.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/request/DeltaSpikeLifecycleWrapper.java
@@ -70,7 +70,10 @@ class DeltaSpikeLifecycleWrapper extends Lifecycle
             windowContext.activateWindow(windowId);
         }
 
-        this.wrapped.execute(facesContext);
+        if (!FacesContext.getCurrentInstance().getResponseComplete())
+        {
+            this.wrapped.execute(facesContext);
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6dacff80/deltaspike/modules/jsf/impl/src/main/resources/META-INF/resources/deltaspike/windowhandler.js
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/resources/META-INF/resources/deltaspike/windowhandler.js b/deltaspike/modules/jsf/impl/src/main/resources/META-INF/resources/deltaspike/windowhandler.js
new file mode 100644
index 0000000..c7f6bca
--- /dev/null
+++ b/deltaspike/modules/jsf/impl/src/main/resources/META-INF/resources/deltaspike/windowhandler.js
@@ -0,0 +1,193 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+(function() {
+//wrapping so that all internal functions are privately scoped
+function isHtml5() {
+    try {
+        return !!localStorage.getItem;
+    } catch(e) {
+        return false;
+    }
+}
+
+// some browsers don't understand JSON - guess which one ... :(
+function stringify(someArray) {
+    if (JSON) {
+        return JSON.stringify(someArray);
+    }
+    return someArray.join("|||");
+}
+
+// store the current body in the html5 localstorage
+function storeWindowTree() {
+    // first we store all CSS we also need on the intermediate page
+    var headNodes = document.getElementsByTagName("head")[0].childNodes;
+    var oldSS = new Array();
+    var j = 0;
+    for (var i = 0; i < headNodes.length; i++) {
+        var tagName = headNodes[i].tagName;
+        if (tagName && equalsIgnoreCase(tagName, "link") &&
+                equalsIgnoreCase(headNodes[i].getAttribute("type"), "text/css")) {
+
+            // sort out media="print" and stuff
+            var media = headNodes[i].getAttribute("media");
+            if (!media || equalsIgnoreCase(media, "all") || equalsIgnoreCase(media, 'screen')) {
+                oldSS[j++] = headNodes[i].getAttribute("href");
+            }
+        }
+    }
+    localStorage.setItem(window.name + '_css', stringify(oldSS));
+    var body = document.getElementsByTagName("body")[0];
+    localStorage.setItem(window.name + '_body', body.innerHTML);
+    //X TODO: store ALL attributes of the body tag
+    localStorage.setItem(window.name + '_bodyAttrs', body.getAttribute("class"));
+    return true;
+}
+
+function equalsIgnoreCase(source, destination) {
+    //either both are not set or null
+    if (!source && !destination) {
+        return true;
+    }
+    //source or dest is set while the other is not
+    if (!source || !destination) return false;
+
+    //in any other case we do a strong string comparison
+    return source.toLowerCase() === destination.toLowerCase();
+}
+
+/** This method will be called onWindowLoad and after AJAX success */
+function applyWindowId() {
+    if (isHtml5()) { // onClick handling
+        var links = document.getElementsByTagName("a");
+        for (var i = 0; i < links.length; i++) {
+            if (!links[i].onclick) {
+                links[i].onclick = function() {storeWindowTree(); return true;};
+            } else {
+                // prevent double decoration
+                if (!("" + links[i].onclick).match(".*storeWindowTree().*")) {
+                    //the function wrapper is important otherwise the
+                    //last onclick handler would be assigned to oldonclick
+                    (function storeEvent() {
+                        var oldonclick = links[i].onclick;
+                        links[i].onclick = function(evt) {
+                            //ie handling added
+                            evt = evt || window.event;
+
+                            return storeWindowTree() && oldonclick(evt);
+                        };
+                    })();
+                }
+            }
+        }
+    }
+    var forms = document.getElementsByTagName("form");
+    for (var i = 0; i < forms.length; i++) {
+        var form = forms[i];
+        var windowIdHolder = form.elements["dsPostWindowId"];
+        if (!windowIdHolder) {
+            windowIdHolder = document.createElement("INPUT");
+            windowIdHolder.name = "dsPostWindowId";
+            windowIdHolder.type = "hidden";
+            form.appendChild(windowIdHolder);
+        }
+
+        windowIdHolder.value = window.deltaspikeJsWindowId;
+    }
+}
+
+function getUrlParameter(name) {
+    var url = window.location.href;
+    var vars = url.split(/&|\?/g);
+    for (var i=0; vars != null && i < vars.length; i++) {
+        var pair = vars[i].split("=");
+        if (pair[0]==name) {
+            return pair[1];
+        }
+    }
+    return null;
+}
+function setUrlParam(baseUrl, paramName, paramValue) {
+    var query = baseUrl;
+    var vars = query.split(/&|\?/g);
+    var newQuery = "";
+    var iParam = 0;
+    var paramFound = false;
+    for (var i=0; vars != null && i < vars.length; i++) {
+        var pair = vars[i].split("=");
+        if (pair.length == 1) {
+            newQuery = pair[0];
+        } else {
+            if (pair[0] != paramName) {
+                var amp = iParam++ > 0 ? "&" : "?";
+                newQuery =  newQuery + amp + pair[0] + "=" + pair[1];
+            } else {
+                paramFound = true;
+                if (paramValue) {
+                    var amp = iParam++ > 0 ? "&" : "?";
+                    newQuery =  newQuery + amp + paramName + "=" + paramValue;
+                }
+            }
+        }
+    }
+    if (!paramFound && paramValue) {
+        var amp = iParam++ > 0 ? "&" : "?";
+        newQuery =  newQuery + amp + paramName + "=" + paramValue;
+    }
+    return newQuery;
+}
+// this method runs to ensure that windowIds get checked even if no windowhandler.html is used
+function assertWindowId() {
+    if (!window.name || window.name.length < 1) {
+        url = setUrlParam(window.location.href, 'windowId', null);
+        window.name = 'tempWindowId';
+        window.location = url;
+    }
+}
+
+function eraseRequestCookie() {
+    var requestToken = getUrlParameter('dsRid'); // random request param
+    if (requestToken) {
+        var cookieName = 'dsiWindowId-' + requestToken;
+        var date = new Date();
+        date.setTime(date.getTime()-(10*24*60*60*1000)); // - 10 day
+        var expires = "; expires="+date.toGMTString();
+        document.cookie = cookieName+"="+expires+"; path=/";
+    }
+}
+
+var ajaxOnClick = function ajaxDecorateClick(event) {
+    if (event.status=="success") {
+        applyWindowId();
+    }
+}
+
+var oldWindowOnLoad = window.onload;
+
+window.onload = function(evt) {
+    try {
+        (oldWindowOnLoad)? oldWindowOnLoad(evt): null;
+    } finally {
+        eraseRequestCookie(); // manually erase the old dsRid cookie because Firefox doesn't do it properly
+        assertWindowId();
+        applyWindowId();
+        jsf.ajax.addOnEvent(ajaxOnClick);
+    }
+}
+})();

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6dacff80/deltaspike/modules/jsf/impl/src/main/resources/META-INF/resources/js/windowhandler.js
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/resources/META-INF/resources/js/windowhandler.js b/deltaspike/modules/jsf/impl/src/main/resources/META-INF/resources/js/windowhandler.js
deleted file mode 100644
index c7f6bca..0000000
--- a/deltaspike/modules/jsf/impl/src/main/resources/META-INF/resources/js/windowhandler.js
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-(function() {
-//wrapping so that all internal functions are privately scoped
-function isHtml5() {
-    try {
-        return !!localStorage.getItem;
-    } catch(e) {
-        return false;
-    }
-}
-
-// some browsers don't understand JSON - guess which one ... :(
-function stringify(someArray) {
-    if (JSON) {
-        return JSON.stringify(someArray);
-    }
-    return someArray.join("|||");
-}
-
-// store the current body in the html5 localstorage
-function storeWindowTree() {
-    // first we store all CSS we also need on the intermediate page
-    var headNodes = document.getElementsByTagName("head")[0].childNodes;
-    var oldSS = new Array();
-    var j = 0;
-    for (var i = 0; i < headNodes.length; i++) {
-        var tagName = headNodes[i].tagName;
-        if (tagName && equalsIgnoreCase(tagName, "link") &&
-                equalsIgnoreCase(headNodes[i].getAttribute("type"), "text/css")) {
-
-            // sort out media="print" and stuff
-            var media = headNodes[i].getAttribute("media");
-            if (!media || equalsIgnoreCase(media, "all") || equalsIgnoreCase(media, 'screen')) {
-                oldSS[j++] = headNodes[i].getAttribute("href");
-            }
-        }
-    }
-    localStorage.setItem(window.name + '_css', stringify(oldSS));
-    var body = document.getElementsByTagName("body")[0];
-    localStorage.setItem(window.name + '_body', body.innerHTML);
-    //X TODO: store ALL attributes of the body tag
-    localStorage.setItem(window.name + '_bodyAttrs', body.getAttribute("class"));
-    return true;
-}
-
-function equalsIgnoreCase(source, destination) {
-    //either both are not set or null
-    if (!source && !destination) {
-        return true;
-    }
-    //source or dest is set while the other is not
-    if (!source || !destination) return false;
-
-    //in any other case we do a strong string comparison
-    return source.toLowerCase() === destination.toLowerCase();
-}
-
-/** This method will be called onWindowLoad and after AJAX success */
-function applyWindowId() {
-    if (isHtml5()) { // onClick handling
-        var links = document.getElementsByTagName("a");
-        for (var i = 0; i < links.length; i++) {
-            if (!links[i].onclick) {
-                links[i].onclick = function() {storeWindowTree(); return true;};
-            } else {
-                // prevent double decoration
-                if (!("" + links[i].onclick).match(".*storeWindowTree().*")) {
-                    //the function wrapper is important otherwise the
-                    //last onclick handler would be assigned to oldonclick
-                    (function storeEvent() {
-                        var oldonclick = links[i].onclick;
-                        links[i].onclick = function(evt) {
-                            //ie handling added
-                            evt = evt || window.event;
-
-                            return storeWindowTree() && oldonclick(evt);
-                        };
-                    })();
-                }
-            }
-        }
-    }
-    var forms = document.getElementsByTagName("form");
-    for (var i = 0; i < forms.length; i++) {
-        var form = forms[i];
-        var windowIdHolder = form.elements["dsPostWindowId"];
-        if (!windowIdHolder) {
-            windowIdHolder = document.createElement("INPUT");
-            windowIdHolder.name = "dsPostWindowId";
-            windowIdHolder.type = "hidden";
-            form.appendChild(windowIdHolder);
-        }
-
-        windowIdHolder.value = window.deltaspikeJsWindowId;
-    }
-}
-
-function getUrlParameter(name) {
-    var url = window.location.href;
-    var vars = url.split(/&|\?/g);
-    for (var i=0; vars != null && i < vars.length; i++) {
-        var pair = vars[i].split("=");
-        if (pair[0]==name) {
-            return pair[1];
-        }
-    }
-    return null;
-}
-function setUrlParam(baseUrl, paramName, paramValue) {
-    var query = baseUrl;
-    var vars = query.split(/&|\?/g);
-    var newQuery = "";
-    var iParam = 0;
-    var paramFound = false;
-    for (var i=0; vars != null && i < vars.length; i++) {
-        var pair = vars[i].split("=");
-        if (pair.length == 1) {
-            newQuery = pair[0];
-        } else {
-            if (pair[0] != paramName) {
-                var amp = iParam++ > 0 ? "&" : "?";
-                newQuery =  newQuery + amp + pair[0] + "=" + pair[1];
-            } else {
-                paramFound = true;
-                if (paramValue) {
-                    var amp = iParam++ > 0 ? "&" : "?";
-                    newQuery =  newQuery + amp + paramName + "=" + paramValue;
-                }
-            }
-        }
-    }
-    if (!paramFound && paramValue) {
-        var amp = iParam++ > 0 ? "&" : "?";
-        newQuery =  newQuery + amp + paramName + "=" + paramValue;
-    }
-    return newQuery;
-}
-// this method runs to ensure that windowIds get checked even if no windowhandler.html is used
-function assertWindowId() {
-    if (!window.name || window.name.length < 1) {
-        url = setUrlParam(window.location.href, 'windowId', null);
-        window.name = 'tempWindowId';
-        window.location = url;
-    }
-}
-
-function eraseRequestCookie() {
-    var requestToken = getUrlParameter('dsRid'); // random request param
-    if (requestToken) {
-        var cookieName = 'dsiWindowId-' + requestToken;
-        var date = new Date();
-        date.setTime(date.getTime()-(10*24*60*60*1000)); // - 10 day
-        var expires = "; expires="+date.toGMTString();
-        document.cookie = cookieName+"="+expires+"; path=/";
-    }
-}
-
-var ajaxOnClick = function ajaxDecorateClick(event) {
-    if (event.status=="success") {
-        applyWindowId();
-    }
-}
-
-var oldWindowOnLoad = window.onload;
-
-window.onload = function(evt) {
-    try {
-        (oldWindowOnLoad)? oldWindowOnLoad(evt): null;
-    } finally {
-        eraseRequestCookie(); // manually erase the old dsRid cookie because Firefox doesn't do it properly
-        assertWindowId();
-        applyWindowId();
-        jsf.ajax.addOnEvent(ajaxOnClick);
-    }
-}
-})();

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6dacff80/deltaspike/modules/jsf/impl/src/main/resources/static/windowhandler.html
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/resources/static/windowhandler.html b/deltaspike/modules/jsf/impl/src/main/resources/static/windowhandler.html
index 30e622a..911fd44 100644
--- a/deltaspike/modules/jsf/impl/src/main/resources/static/windowhandler.html
+++ b/deltaspike/modules/jsf/impl/src/main/resources/static/windowhandler.html
@@ -164,7 +164,7 @@ window.onload = function() {
     var newUrl = setUrlParam(window.location.href, "dsRid", requestToken);
 
     // we still add hte windowId page param to support lazy windowId dropping for some clients
-    newUrl = setUrlParam(newUrl, "windowId", windowId);
+    newUrl = setUrlParam(newUrl, "windowId", urlId);
 
     document.cookie = 'dsWindowId-' + requestToken + '=' + windowId + expires+"; path=/";
 

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6dacff80/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowScopedContextTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowScopedContextTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowScopedContextTest.java
index 6f84fe8..c57b16c 100644
--- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowScopedContextTest.java
+++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/WindowScopedContextTest.java
@@ -66,8 +66,10 @@ public class WindowScopedContextTest
                 .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndJsfArchive())
                 .addAsLibraries(ArchiveUtils.getDeltaSpikeSecurityArchive())
                 .addAsWebInfResource("default/WEB-INF/web.xml", "web.xml")
-                .addAsWebResource("META-INF/resources/js/windowhandler.js", "resources/js/windowhandler.js")
+                .addAsWebResource("META-INF/resources/deltaspike/windowhandler.js",
+                                  "resources/deltaspike/windowhandler.js")
                 .addAsWebResource("windowScopedContextTest/page.xhtml", "page.xhtml")
+                .addAsWebResource("windowScopedContextTest/page2.xhtml", "page2.xhtml")
                 .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
     }
 
@@ -77,7 +79,8 @@ public class WindowScopedContextTest
     public void testWindowId() throws Exception
     {
         System.out.println("contextpath= " + contextPath);
-        //X Thread.sleep(600000L);
+        //X
+        Thread.sleep(600000L);
 
         driver.get(new URL(contextPath, "page.xhtml").toString());
 

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6dacff80/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/beans/WindowScopedBackingBean.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/beans/WindowScopedBackingBean.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/beans/WindowScopedBackingBean.java
index 8a58d48..ce0c30c 100644
--- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/beans/WindowScopedBackingBean.java
+++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/test/jsf/impl/scope/window/beans/WindowScopedBackingBean.java
@@ -44,7 +44,6 @@ public class WindowScopedBackingBean implements Serializable
 
     public String someAction()
     {
-        // stay on the page.
-        return null;
+        return "page2?faces-redirect=true";
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6dacff80/deltaspike/modules/jsf/impl/src/test/resources/windowScopedContextTest/page.xhtml
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/test/resources/windowScopedContextTest/page.xhtml b/deltaspike/modules/jsf/impl/src/test/resources/windowScopedContextTest/page.xhtml
index c0a64c4..194270f 100644
--- a/deltaspike/modules/jsf/impl/src/test/resources/windowScopedContextTest/page.xhtml
+++ b/deltaspike/modules/jsf/impl/src/test/resources/windowScopedContextTest/page.xhtml
@@ -41,6 +41,8 @@
         <h:outputText id="valueOutput" value="#{windowScopedBean.i}"/>
         <br/>
         <h:commandButton id="saveButton" action="#{windowScopedBean.someAction}" value="save"/>
+        <br/>
+        <h:link value="forward to page2 via GET" outcome="page2.xhtml"/>
     </h:form>
 </div>
 </h:body>

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/6dacff80/deltaspike/modules/jsf/impl/src/test/resources/windowScopedContextTest/page2.xhtml
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/test/resources/windowScopedContextTest/page2.xhtml b/deltaspike/modules/jsf/impl/src/test/resources/windowScopedContextTest/page2.xhtml
new file mode 100644
index 0000000..6a8562a
--- /dev/null
+++ b/deltaspike/modules/jsf/impl/src/test/resources/windowScopedContextTest/page2.xhtml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:h="http://java.sun.com/jsf/html"
+      xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:ui="http://java.sun.com/jsf/facelets"
+      xmlns:c="http://java.sun.com/jsp/jstl/core"
+      xmlns:ds="http://deltaspike.apache.org/jsf">
+
+<h:head>
+
+</h:head>
+
+<h:body>
+<ds:windowId/>
+<div>
+    <h:outputLabel for="valueOutput" value="backing bean value:"/>
+    <h:outputText id="valueOutput" value="#{windowScopedBean.i}"/>
+    <br/>
+</div>
+</h:body>
+</html>