You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2020/06/03 11:54:40 UTC
[myfaces] branch master updated: use TCCL for quarkus web.xml
This is an automated email from the ASF dual-hosted git repository.
tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git
The following commit(s) were added to refs/heads/master by this push:
new 1b4127b use TCCL for quarkus web.xml
1b4127b is described below
commit 1b4127bd0660c17cf5de1fb3dca066ee805a9b36
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Wed Jun 3 13:54:29 2020 +0200
use TCCL for quarkus web.xml
---
.../java/org/apache/myfaces/core/api/shared/_ClassUtils.java | 10 ++++++++++
impl/src/main/java/org/apache/myfaces/util/WebXmlParser.java | 3 ++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/api/src/main/java/org/apache/myfaces/core/api/shared/_ClassUtils.java b/api/src/main/java/org/apache/myfaces/core/api/shared/_ClassUtils.java
index 62eb765..89e05f3 100755
--- a/api/src/main/java/org/apache/myfaces/core/api/shared/_ClassUtils.java
+++ b/api/src/main/java/org/apache/myfaces/core/api/shared/_ClassUtils.java
@@ -474,6 +474,16 @@ public class _ClassUtils
return loader;
}
+ public static ClassLoader getCurrentLoader(Class<?> clazz)
+ {
+ ClassLoader loader = getContextClassLoader();
+ if (loader == null && clazz != null)
+ {
+ loader = clazz.getClassLoader();
+ }
+ return loader;
+ }
+
/**
* Gets the ClassLoader associated with the current thread. Returns the class loader associated with the specified
* default object if no context loader is associated with the current thread.
diff --git a/impl/src/main/java/org/apache/myfaces/util/WebXmlParser.java b/impl/src/main/java/org/apache/myfaces/util/WebXmlParser.java
index c0e93fe..585a4ed 100755
--- a/impl/src/main/java/org/apache/myfaces/util/WebXmlParser.java
+++ b/impl/src/main/java/org/apache/myfaces/util/WebXmlParser.java
@@ -35,6 +35,7 @@ import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
+import org.apache.myfaces.util.lang.ClassUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -113,7 +114,7 @@ public class WebXmlParser
if (webXml == null)
{
// Quarkus
- webXml = toDocument(context.getResource("/META-INF/web.xml"));
+ webXml = toDocument(ClassUtils.getCurrentLoader(WebXmlParser.class).getResource("META-INF/web.xml"));
}
if (webXml != null)