tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets ManagerServlet.java
Date Fri, 24 May 2002 18:01:50 GMT
remm        02/05/24 11:01:50

  Modified:    catalina/src/share/org/apache/catalina/servlets
                        ManagerServlet.java
  Log:
  - Improve the type filtering to use instanceof.
  
  Revision  Changes    Path
  1.23      +21 -9     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/ManagerServlet.java
  
  Index: ManagerServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/ManagerServlet.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- ManagerServlet.java	24 May 2002 17:41:48 -0000	1.22
  +++ ManagerServlet.java	24 May 2002 18:01:50 -0000	1.23
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/ManagerServlet.java,v
1.22 2002/05/24 17:41:48 remm Exp $
  - * $Revision: 1.22 $
  - * $Date: 2002/05/24 17:41:48 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/ManagerServlet.java,v
1.23 2002/05/24 18:01:50 remm Exp $
  + * $Revision: 1.23 $
  + * $Date: 2002/05/24 18:01:50 $
    *
    * ====================================================================
    *
  @@ -198,7 +198,7 @@
    * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.22 $ $Date: 2002/05/24 17:41:48 $
  + * @version $Revision: 1.23 $ $Date: 2002/05/24 18:01:50 $
    */
   
   public class ManagerServlet
  @@ -805,7 +805,19 @@
               writer.println(sm.getString("managerServlet.resourcesAll"));
           }
   
  -        printResources(writer, "", global, type);
  +        Class clazz = null;
  +        try {
  +            if (type != null) {
  +                clazz = Class.forName(type);
  +            }
  +        } catch (Throwable t) {
  +            log("ManagerServlet.resources[" + type + "]", t);
  +            writer.println(sm.getString("managerServlet.exception",
  +                                        t.toString()));
  +            return;
  +        }
  +
  +        printResources(writer, "", global, type, clazz);
   
       }
   
  @@ -815,7 +827,7 @@
        */
       protected void printResources(PrintWriter writer, String prefix,
                                     javax.naming.Context namingContext,
  -                                  String type) {
  +                                  String type, Class clazz) {
   
           try {
               NamingEnumeration items = namingContext.listBindings("");
  @@ -824,10 +836,10 @@
                   if (item.getObject() instanceof javax.naming.Context) {
                       printResources
                           (writer, prefix + item.getName() + "/",
  -                         (javax.naming.Context) item.getObject(), type);
  +                         (javax.naming.Context) item.getObject(), type, clazz);
                   } else {
  -                    if ((type != null) &&
  -                        (!type.equals(item.getClassName()))) {
  +                    if ((clazz != null) &&
  +                        (!(clazz.isInstance(item.getObject())))) {
                           continue;
                       }
                       writer.print(prefix + item.getName());
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message