This is an automated email from the ASF dual-hosted git repository.
schultz pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 402d89056d Use server's ClassLoader instead of application's when
loading XMLInputFactory.
402d89056d is described below
commit 402d89056dbf5a22a68ddaa6d2a9a1f2c97ec30a
Author: Christopher Schultz <[email protected]>
AuthorDate: Fri Mar 22 09:37:08 2024 -0400
Use server's ClassLoader instead of application's when loading
XMLInputFactory.
---
java/org/apache/jasper/compiler/EncodingDetector.java | 3 ++-
webapps/docs/changelog.xml | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/jasper/compiler/EncodingDetector.java
b/java/org/apache/jasper/compiler/EncodingDetector.java
index bac9ade2ee..cf3b623104 100644
--- a/java/org/apache/jasper/compiler/EncodingDetector.java
+++ b/java/org/apache/jasper/compiler/EncodingDetector.java
@@ -35,7 +35,8 @@ class EncodingDetector {
private static final XMLInputFactory XML_INPUT_FACTORY;
static {
- XML_INPUT_FACTORY = XMLInputFactory.newInstance();
+ XML_INPUT_FACTORY =
XMLInputFactory.newFactory(XMLInputFactory.class.getName(),
+ EncodingDetector.class.getClassLoader());
}
private final String encoding;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f3eef2e650..a3839123e4 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -225,6 +225,11 @@
and the web application is deployed as a WAR file rather than an
unpacked directory. (markt)
</fix>
+ <fix>
+ Prevent the web application's ClassLoader from being pinned by the JSP
+ compiler if an application uses a custom XMLInputFactory. Based upon a
+ suggestion from Simon Niederberger. (schultz)
+ </fix>
</changelog>
</subsection>
<subsection name="Cluster">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]