deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject deltaspike git commit: DELTASPIKE-1078 Request binding throws exception when using forwards
Date Wed, 17 Feb 2016 15:00:53 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 6ba0b0bad -> 0cfa2517e


DELTASPIKE-1078 Request binding throws exception when using forwards

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

Branch: refs/heads/master
Commit: 0cfa2517e5493b55fb9d494fe490973c24da9859
Parents: 6ba0b0b
Author: tandraschko <tandraschko@apache.org>
Authored: Wed Feb 17 16:00:17 2016 +0100
Committer: tandraschko <tandraschko@apache.org>
Committed: Wed Feb 17 16:00:17 2016 +0100

----------------------------------------------------------------------
 .../servlet/impl/produce/RequestResponseHolder.java       | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/0cfa2517/deltaspike/modules/servlet/impl/src/main/java/org/apache/deltaspike/servlet/impl/produce/RequestResponseHolder.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/servlet/impl/src/main/java/org/apache/deltaspike/servlet/impl/produce/RequestResponseHolder.java
b/deltaspike/modules/servlet/impl/src/main/java/org/apache/deltaspike/servlet/impl/produce/RequestResponseHolder.java
index 3660d9f..e66b0d1 100644
--- a/deltaspike/modules/servlet/impl/src/main/java/org/apache/deltaspike/servlet/impl/produce/RequestResponseHolder.java
+++ b/deltaspike/modules/servlet/impl/src/main/java/org/apache/deltaspike/servlet/impl/produce/RequestResponseHolder.java
@@ -59,6 +59,16 @@ class RequestResponseHolder<Type>
     {
         if (isBound())
         {
+            // ignore forwards - Tomcat calls #requestInitialized two times with form authentication
+            if (instance instanceof ServletRequest)
+            {
+                ServletRequest servletRequest = (ServletRequest) instance;
+                if (servletRequest.getAttribute("javax.servlet.forward.request_uri") != null)
+                {
+                    return;
+                }
+            }
+
             throw new IllegalStateException("There is already an instance bound to this thread.");
         }
         threadLocal.set(instance);


Mime
View raw message