You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2020/12/08 15:31:06 UTC

[tomcat] branch 8.5.x updated: 64965: Avoid JspContextWrapper ISE in findAttribute

This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new eb951f1  64965: Avoid JspContextWrapper ISE in findAttribute
eb951f1 is described below

commit eb951f1d05528cd38ab015b4f473e54f31d6f2a8
Author: remm <re...@apache.org>
AuthorDate: Tue Dec 8 16:24:39 2020 +0100

    64965: Avoid JspContextWrapper ISE in findAttribute
    
    JspContextWrapper.findAttribute should ignore expired sessions rather
    than throw an IllegalStateException.
---
 java/org/apache/jasper/runtime/JspContextWrapper.java | 7 ++++++-
 webapps/docs/changelog.xml                            | 9 +++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/jasper/runtime/JspContextWrapper.java b/java/org/apache/jasper/runtime/JspContextWrapper.java
index 2b60097..f969851 100644
--- a/java/org/apache/jasper/runtime/JspContextWrapper.java
+++ b/java/org/apache/jasper/runtime/JspContextWrapper.java
@@ -200,7 +200,12 @@ public class JspContextWrapper extends PageContext implements VariableResolver {
             o = rootJspCtxt.getAttribute(name, REQUEST_SCOPE);
             if (o == null) {
                 if (getSession() != null) {
-                    o = rootJspCtxt.getAttribute(name, SESSION_SCOPE);
+                    try {
+                        o = rootJspCtxt.getAttribute(name, SESSION_SCOPE);
+                    } catch (IllegalStateException ise) {
+                        // Session has been invalidated.
+                        // Ignore and fall through to application scope.
+                    }
                 }
                 if (o == null) {
                     o = rootJspCtxt.getAttribute(name, APPLICATION_SCOPE);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index eb7309e..09dc89f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -131,6 +131,15 @@
       </add>
     </changelog>
   </subsection>
+  <subsection name="Jasper">
+    <changelog>
+      <fix>
+        <bug>64965</bug>: <code>JspContextWrapper.findAttribute</code> should
+        ignore expired sessions rather than throw an
+        <code>IllegalStateException</code>. (remm)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Other">
     <changelog>
       <add>


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