craigmcc 02/01/25 18:01:57 Modified: catalina/src/share/org/apache/catalina/core StandardWrapper.java Log: Remove the undocumented (and needless) restriction that container provided servlets must have a fully qualified name starting with org.apache.catalina. Change the name of isContainerServlet() to isContainerProvidedServlet() to better distinguish the fact that we're checking which class loader to use (in other words, was this servlet found in server/classes or server/lib) -- checking for a ContainerServlet can be done later (when necessary) with an instanceof check. Revision Changes Path 1.36 +19 -12 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapper.java Index: StandardWrapper.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapper.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- StandardWrapper.java 11 Dec 2001 18:56:03 -0000 1.35 +++ StandardWrapper.java 26 Jan 2002 02:01:56 -0000 1.36 @@ -1,13 +1,13 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapper.java,v 1.35 2001/12/11 18:56:03 remm Exp $ - * $Revision: 1.35 $ - * $Date: 2001/12/11 18:56:03 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapper.java,v 1.36 2002/01/26 02:01:56 craigmcc Exp $ + * $Revision: 1.36 $ + * $Date: 2002/01/26 02:01:56 $ * * ==================================================================== * * The Apache Software License, Version 1.1 * - * Copyright (c) 1999 The Apache Software Foundation. All rights + * Copyright (c) 1999-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -102,7 +102,7 @@ * * @author Craig R. McClanahan * @author Remy Maucherat - * @version $Revision: 1.35 $ $Date: 2001/12/11 18:56:03 $ + * @version $Revision: 1.36 $ $Date: 2002/01/26 02:01:56 $ */ public final class StandardWrapper @@ -852,8 +852,8 @@ ClassLoader classLoader = loader.getClassLoader(); - // Special case class loader for a Catalina internal servlet - if (isContainerServlet(actualClass)) { + // Special case class loader for a container provided servlet + if (isContainerProvidedServlet(actualClass)) { classLoader = this.getClass().getClassLoader(); log(sm.getString ("standardWrapper.containerServlet", getName())); @@ -905,7 +905,7 @@ // Special handling for ContainerServlet instances if ((servlet instanceof ContainerServlet) && - isContainerServlet(actualClass)) { + isContainerProvidedServlet(actualClass)) { ((ContainerServlet) servlet).setWrapper(this); } @@ -1203,16 +1203,23 @@ /** * Return <code>true</code> if the specified class name represents a - * container class that should be loaded by the system class loader. + * container provided servlet class that should be loaded by the + * server class loader. * * @param name Name of the class to be checked */ - private boolean isContainerServlet(String classname) { + private boolean isContainerProvidedServlet(String classname) { - if (classname.startsWith("org.apache.catalina.")) + if (classname.startsWith("org.apache.catalina.")) { return (true); - else + } + try { + Class clazz = + this.getClass().getClassLoader().loadClass(classname); + return (ContainerServlet.class.isAssignableFrom(clazz)); + } catch (Throwable t) { return (false); + } }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>