remm        2003/09/22 12:30:17

  Modified:    webapps/manager/WEB-INF/classes/org/apache/catalina/manager
                        ManagerServlet.java
  Log:
  - Code cleanup.
  - Fix for root context handling.
  
  Revision  Changes    Path
  1.12      +21 -17    
jakarta-tomcat-catalina/webapps/manager/WEB-INF/classes/org/apache/catalina/manager/ManagerServlet.java
  
  Index: ManagerServlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/webapps/manager/WEB-INF/classes/org/apache/catalina/manager/ManagerServlet.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ManagerServlet.java       22 Sep 2003 12:34:45 -0000      1.11
  +++ ManagerServlet.java       22 Sep 2003 19:30:17 -0000      1.12
  @@ -611,12 +611,7 @@
           String displayPath = path;
           if( path.equals("/") )
               path = "";
  -        String basename = null;
  -        if (path.equals("")) {
  -            basename = "_";
  -        } else {
  -            basename = path.substring(1).replace('/', '_');
  -        }
  +        String basename = getConfigFile(path);
   
           // Check if app already exists, or undeploy it if updating
           Context context =  deployer.findDeployedApp(path);
  @@ -724,12 +719,7 @@
           String displayPath = path;
           if( path.equals("/") )
               path = "";
  -        String basename = null;
  -        if (path.equals("")) {
  -            basename = "_";
  -        } else {
  -            basename = path.substring(1).replace('/', '_');
  -        }
  +        String basename = getConfigFile(path);
   
           // Calculate the base path
           File deployedPath = versioned;
  @@ -902,7 +892,7 @@
                       writer.println(sm.getString("managerServlet.invalidWar", war));
                       return;
                   }
  -                path = "/" + war.substring(beg,end);
  +                path = "/" + war.substring(beg, end);
                   if (path.equals("/ROOT")) {
                       path = "/";
                   }
  @@ -1485,6 +1475,20 @@
   
   
       // -------------------------------------------------------- Support Methods
  +
  +
  +    /**
  +     * Given a context path, get the config file name.
  +     */
  +    protected String getConfigFile(String path) {
  +        String basename = null;
  +        if (path.equals("")) {
  +            basename = "ROOT";
  +        } else {
  +            basename = path.substring(1).replace('/', '_');
  +        }
  +        return (basename);
  +    }
   
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to