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 2021/03/10 13:18:52 UTC
[myfaces] branch 2.3.x updated: MYFACES-4382: Add check if
SessionScope is active.
This is an automated email from the ASF dual-hosted git repository.
tandraschko pushed a commit to branch 2.3.x
in repository https://gitbox.apache.org/repos/asf/myfaces.git
The following commit(s) were added to refs/heads/2.3.x by this push:
new f6c663d MYFACES-4382: Add check if SessionScope is active.
new e983534 Merge pull request #182 from j-be/PR_MYFACES-4382_2.3.x
f6c663d is described below
commit f6c663de675a19cf120d1b377e33d81a24d50574
Author: Juri Berlanda <ju...@tuwien.ac.at>
AuthorDate: Wed Mar 10 13:39:48 2021 +0100
MYFACES-4382: Add check if SessionScope is active.
This avoids "@SessionScoped does not exist within current thread" when
trying to destroy ViewScoped and FlowScoped beans.
Signed-off-by: Juri Berlanda <ju...@tuwien.ac.at>
---
.../java/org/apache/myfaces/cdi/impl/CDIManagedBeanHandlerImpl.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/impl/src/main/java/org/apache/myfaces/cdi/impl/CDIManagedBeanHandlerImpl.java b/impl/src/main/java/org/apache/myfaces/cdi/impl/CDIManagedBeanHandlerImpl.java
index 66d7cf6..287c29a 100644
--- a/impl/src/main/java/org/apache/myfaces/cdi/impl/CDIManagedBeanHandlerImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/cdi/impl/CDIManagedBeanHandlerImpl.java
@@ -106,7 +106,8 @@ public class CDIManagedBeanHandlerImpl extends ViewScopeProvider
FacesContext facesContext = FacesContext.getCurrentInstance();
if (facesContext != null)
{
- if (facesContext.getExternalContext().getSession(false) != null)
+ if (facesContext.getExternalContext().getSession(false) != null &&
+ CDIUtils.isSessionScopeActive(beanManager))
{
if (isViewScopeBeanHolderCreated(facesContext))
{