Author: markt
Date: Tue Apr 28 13:45:50 2009
New Revision: 769403

URL: http://svn.apache.org/viewvc?rev=769403&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=37929
Invalidated session causes pageContext methods to fail

Removed:
    tomcat/tc6.0.x/trunk/bin/Tomcat6.launch
Modified:
    tomcat/tc6.0.x/trunk/   (props changed)
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc6.0.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 28 13:45:50 2009
@@ -1 +1 @@
-/tomcat/trunk:601180,606992,612607,630314,640888,652744,653247,673796,673820,683982,684001,684081,684234,684269-684270,685177,687503,687645,689402,690781,691392,691805,692748,693378,694992,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,701355,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,712467,718360,719119,719124,719602,719626,719628,720046,720069,721040,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,729571,729681,729809,729815,729934,730250,730590,731651,732859,732863,734734,740675,740684,742677,742697,742714,744160,744238,746321,746384,747834,747863,748344,750258,750291,750921,751286-751287,751295,757774,758596,758616,758664,759074,761601,762868,762929,762936-762937,763166,763183,763193,763302,763599,763681,763706,768335
+/tomcat/trunk:601180,606992,612607,630314,640888,652744,653247,673796,673820,683982,684001,684081,684234,684269-684270,685177,687503,687645,689402,690781,691392,691805,692748,693378,694992,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,701355,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,712467,718360,719119,719124,719602,719626,719628,720046,720069,721040,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,729571,729681,729809,729815,729934,730250,730590,731651,732859,732863,734734,740675,740684,742677,742697,742714,744160,744238,746321,746384,747834,747863,748344,750258,750291,750921,751286-751287,751295,757774,758596,758616,758664,759074,761601,762868,762929,762936-762937,763166,763183,763193,763302,763599,763681,763706,765662,768335

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=769403&r1=769402&r2=769403&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Apr 28 13:45:50 2009
@@ -162,12 +162,6 @@
   -0: remm: Why should this be backported ?
   -1: 
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=37929
-  Invalidated session causes pageContext methods to fail
-  http://svn.apache.org/viewvc?rev=765662&view=rev
-  +1: markt, remm, rjung
-  -1: 
-
 * Fix use of non-ASCII characters in property files
   http://people.apache.org/~markt/patches/2009-04-20-native2ascii-de.patch 
(German)
   http://people.apache.org/~markt/patches/2009-04-20-native2ascii-en.patch 
(English)

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java?rev=769403&r1=769402&r2=769403&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java 
Tue Apr 28 13:45:50 2009
@@ -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() {

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=769403&r1=769402&r2=769403&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Tue Apr 28 13:45:50 2009
@@ -100,6 +100,10 @@
   <subsection name="Jasper">
     <changelog>
       <fix>
+        <bug>37929</bug>: Fix invalidated session causing pageContext methods 
to
+        fail. (markt)
+      </fix>
+      <fix>
         <bug>41606</bug>: Prevent double initialisation of JSPs. Patch provided
         by Chris Halstead. (markt)
       </fix>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to