[jbossweb-commits] JBossWeb SVN: r2292 - branches/2.1.x/java/org/apache/jasper/runtime.

jbossweb-commits at lists.jboss.org jbossweb-commits at lists.jboss.org
Fri Oct 25 15:40:23 EDT 2013


Author: aogburn
Date: 2013-10-25 15:40:22 -0400 (Fri, 25 Oct 2013)
New Revision: 2292

Modified:
   branches/2.1.x/java/org/apache/jasper/runtime/PageContextImpl.java
Log:
[JBWEB-284] backport fix for PageContextImpl IllegalStateException

Modified: branches/2.1.x/java/org/apache/jasper/runtime/PageContextImpl.java
===================================================================
--- branches/2.1.x/java/org/apache/jasper/runtime/PageContextImpl.java	2013-10-24 04:02:52 UTC (rev 2291)
+++ branches/2.1.x/java/org/apache/jasper/runtime/PageContextImpl.java	2013-10-25 19:40:22 UTC (rev 2292)
@@ -421,8 +421,13 @@
 			return REQUEST_SCOPE;
 
 		if (session != null) {
-			if (session.getAttribute(name) != null)
-				return SESSION_SCOPE;
+            try {
+                if (session.getAttribute(name) != null)
+                    return SESSION_SCOPE;
+            } catch(IllegalStateException ise) {
+                // Session has been invalidated.
+                // Ignore and fall through to application scope.
+            }
 		}
 
 		if (context.getAttribute(name) != null)
@@ -464,7 +469,12 @@
 			return o;
 
 		if (session != null) {
-			o = session.getAttribute(name);
+            try {
+                o = session.getAttribute(name);
+            } catch(IllegalStateException ise) {
+                // Session has been invalidated.
+                // Ignore and fall through to application scope.
+            }
 			if (o != null)
 				return o;
 		}
@@ -528,17 +538,17 @@
 	}
 
 	private void doRemoveAttribute(String name) {
-		try {
-			removeAttribute(name, PAGE_SCOPE);
-			removeAttribute(name, REQUEST_SCOPE);
-			if (session != null) {
-				removeAttribute(name, SESSION_SCOPE);
-			}
-			removeAttribute(name, APPLICATION_SCOPE);
-		} catch (Exception ex) {
-			// we remove as much as we can, and
-			// simply ignore possible exceptions
-		}
+        removeAttribute(name, PAGE_SCOPE);
+        removeAttribute(name, REQUEST_SCOPE);
+        if( session != null ) {
+            try {
+                removeAttribute(name, SESSION_SCOPE);
+            } catch(IllegalStateException ise) {
+                // Session has been invalidated.
+                // Ignore and fall throw to application scope.
+            }
+        }
+        removeAttribute(name, APPLICATION_SCOPE);
 	}
 
 	public JspWriter getOut() {


Property changes on: branches/2.1.x/java/org/apache/jasper/runtime/PageContextImpl.java
___________________________________________________________________
Added: svn:mergeinfo
   + /trunk/java/org/apache/jasper/runtime/PageContextImpl.java:1009



More information about the jbossweb-commits mailing list