tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: ensure request scope is initialized a single time in embedded mode
Date Wed, 31 Dec 2014 10:13:16 GMT
Repository: tomee
Updated Branches:
  refs/heads/tomee-1.7.x 14e61885c -> 8b1d653aa


ensure request scope is initialized a single time in embedded mode


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

Branch: refs/heads/tomee-1.7.x
Commit: 8b1d653aaba6d3c8fd390a030cb61a034f40da89
Parents: 14e6188
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Wed Dec 31 11:12:54 2014 +0100
Committer: Romain Manni-Bucau <rmannibucau@apache.org>
Committed: Wed Dec 31 11:12:54 2014 +0100

----------------------------------------------------------------------
 .../apache/openejb/server/httpd/FilterListener.java   |  2 +-
 .../apache/openejb/server/httpd/HttpRequestImpl.java  | 14 ++++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/8b1d653a/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/FilterListener.java
----------------------------------------------------------------------
diff --git a/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/FilterListener.java
b/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/FilterListener.java
index 20b8179..e726fca 100644
--- a/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/FilterListener.java
+++ b/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/FilterListener.java
@@ -47,7 +47,7 @@ public class FilterListener implements HttpListener {
             }
         }
         if (req != null) {
-            req.initPathFromContext(context);
+            req.initPathFromContext((!context.startsWith("/") ? "/" : "") + context);
         }
         delegate.doFilter(request, response, new SimpleFilterChain(this));
     }

http://git-wip-us.apache.org/repos/asf/tomee/blob/8b1d653a/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/HttpRequestImpl.java
----------------------------------------------------------------------
diff --git a/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/HttpRequestImpl.java
b/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/HttpRequestImpl.java
index 0aaaef8..a48ed59 100644
--- a/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/HttpRequestImpl.java
+++ b/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/HttpRequestImpl.java
@@ -1083,21 +1083,27 @@ public class HttpRequestImpl implements HttpRequest {
     }
 
     public void setEndListener(final EndWebBeansListener end) {
-        this.end = end;
+        if (this.end == null) {
+            this.end = end;
+        }
     }
 
     public void setBeginListener(final BeginWebBeansListener begin) {
-        this.begin = begin;
+        if (this.begin == null) {
+            this.begin = begin;
+        }
     }
 
     public void init() {
-        if (begin != null) {
+        if (begin != null && getAttribute("openejb_requestInitialized") == null)
{
+            setAttribute("openejb_requestInitialized", "ok");
             begin.requestInitialized(new ServletRequestEvent(getServletContext(), this));
         }
     }
 
     public void destroy() {
-        if (end != null) {
+        if (end != null && getAttribute("openejb_requestDestroyed") == null) {
+            setAttribute("openejb_requestDestroyed", "ok");
             end.requestDestroyed(new ServletRequestEvent(getServletContext(), this));
         }
     }


Mime
View raw message