You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bi...@apache.org on 2005/12/18 02:07:55 UTC

svn commit: r357410 - /tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java

Author: billbarker
Date: Sat Dec 17 17:07:51 2005
New Revision: 357410

URL: http://svn.apache.org/viewcvs?rev=357410&view=rev
Log:
Don't stop on the generic attribute methods just because the session is invalid.

In private emails, I've satisfied myself with the IP issues, and the patch is nice :).

Fix for Bug #37929
Submitted By (with minor style changes):  Pierre Delisle (pierre.delisle at sun dot com)

Modified:
    tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java

Modified: tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java?rev=357410&r1=357409&r2=357410&view=diff
==============================================================================
--- tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java (original)
+++ tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java Sat Dec 17 17:07:51 2005
@@ -424,8 +424,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;
         }
@@ -533,17 +543,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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org