This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new a511d72 64965: Avoid JspContextWrapper ISE in findAttribute
a511d72 is described below
commit a511d720b941bff888a5aa455b960c1ad990ebe3
Author: remm <[email protected]>
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 a984667..020b57f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -124,6 +124,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: [email protected]
For additional commands, e-mail: [email protected]