Author: markt
Date: Thu Apr 16 15:16:43 2009
New Revision: 765662

URL: http://svn.apache.org/viewvc?rev=765662&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=37929 by restoring 
r357410 that was lost in r379417

Modified:
    tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java

Modified: tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java?rev=765662&r1=765661&r2=765662&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java Thu Apr 16 
15:16:43 2009
@@ -423,8 +423,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)
@@ -467,7 +472,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;
                }
@@ -531,17 +541,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() {



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to