myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wtl...@apache.org
Subject [myfaces] branch 2.2.x updated: avoid CNFE in getFacesServletMappings
Date Mon, 18 Mar 2019 18:55:07 GMT
This is an automated email from the ASF dual-hosted git repository.

wtlucy pushed a commit to branch 2.2.x
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/2.2.x by this push:
     new 2d16989  avoid CNFE in getFacesServletMappings
     new c1e6daa  Merge pull request #48 from wtlucy/getFacesServletMappings_CNFE_2.2
2d16989 is described below

commit 2d16989c0f6b83cbcef3e18bfa69a0f84fad5bbc
Author: Bill Lucy <wtlucy@gmail.com>
AuthorDate: Fri Mar 15 15:37:16 2019 -0400

    avoid CNFE in getFacesServletMappings
---
 .../apache/myfaces/shared_impl/webapp/webxml/WebXml.java    | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXml.java b/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXml.java
index d96d599..6a33cc0 100644
--- a/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXml.java
+++ b/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXml.java
@@ -30,6 +30,7 @@ import javax.faces.context.ExternalContext;
 import javax.faces.webapp.FacesServlet;
 
 import org.apache.myfaces.shared.config.MyfacesConfig;
+import org.apache.myfaces.shared.util.ClassUtils;
 
 /**
  * @author Manfred Geiler (latest modification by $Author$)
@@ -133,7 +134,17 @@ public class WebXml
                 // </servlet>
                 continue;
             }
-            Class servletClass = org.apache.myfaces.shared.util.ClassUtils.simpleClassForName((String)entry.getValue());
+
+            Class servletClass = ClassUtils.simpleClassForName((String) entry.getValue(),
false);
+            if (servletClass == null)
+            {
+                if (log.isLoggable(Level.FINEST))
+                {
+                    log.finest("ignoring servlet " + servletName + " because its class could
not be loaded");
+                }
+                continue;
+            }
+
             if (FacesServlet.class.isAssignableFrom(servletClass) ||
                     DelegatedFacesServlet.class.isAssignableFrom(servletClass) ||
                     servletClass.getName().equals(_delegateFacesServlet))


Mime
View raw message