You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2019/07/22 11:01:10 UTC

[myfaces] branch 2.2.x updated: MYFACES-4297

This is an automated email from the ASF dual-hosted git repository.

tandraschko pushed a commit to branch 2.2.x
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/2.2.x by this push:
     new b1ccc47  MYFACES-4297
b1ccc47 is described below

commit b1ccc47267c8dc1e847c883c9ccc3cf295d87ac3
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Mon Jul 22 13:01:02 2019 +0200

    MYFACES-4297
---
 .../main/java/org/apache/myfaces/cdi/view/ViewScopeContextImpl.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeContextImpl.java b/impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeContextImpl.java
index 122aeb1..c1c8959 100644
--- a/impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeContextImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeContextImpl.java
@@ -132,6 +132,9 @@ public class ViewScopeContextImpl implements Context
     {
         checkActive();
 
+        // force session creation if ViewScoped is used
+        FacesContext.getCurrentInstance().getExternalContext().getSession(true);
+
         ViewScopeContextualStorage storage = getContextualStorage(false);
         if (storage == null)
         {
@@ -158,6 +161,9 @@ public class ViewScopeContextImpl implements Context
                     " doesn't implement " + PassivationCapable.class.getName());
         }
 
+        // force session creation if ViewScoped is used
+        FacesContext.getCurrentInstance().getExternalContext().getSession(true);
+
         ViewScopeContextualStorage storage = getContextualStorage(true);
 
         Map<Object, ContextualInstanceInfo<?>> contextMap = storage.getStorage();