Author: struberg
Date: Thu Aug 23 19:46:58 2018
New Revision: 1838755

URL: http://svn.apache.org/viewvc?rev=1838755&view=rev
Log:
OWB-1252 fix RequestContext handling in WebContextsService

txs to Tamas Kimmel for the bug report and hint what to fix!

Modified:
    
openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java

Modified: 
openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
URL: 
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java?rev=1838755&r1=1838754&r2=1838755&view=diff
==============================================================================
--- 
openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
 (original)
+++ 
openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
 Thu Aug 23 19:46:58 2018
@@ -255,6 +255,11 @@ public class WebContextsService extends
     @Override
     public Context getCurrentContext(Class<? extends Annotation> scopeType, 
boolean createIfNotExists)
     {
+        if(scopeType.equals(RequestScoped.class))
+        {
+            return getRequestContext(createIfNotExists);
+        }
+
         if(scopeType.equals(SessionScoped.class))
         {
             return getSessionContext(createIfNotExists);
@@ -732,6 +737,7 @@ public class WebContextsService extends
         if (requestContext == null && create)
         {
             initRequestContext(null);
+            requestContext = requestContexts.get();
         }
         return requestContext;
     }


Reply via email to