remm        2003/08/06 10:50:22

  Modified:    webapps/manager/WEB-INF/classes/org/apache/catalina/manager
                        ManagerServlet.java
  Log:
  - Cleanup URL handling, to be consistent with the HTML manager.
  - Don't send extra "OK" messages.
  - Fix update flag (which was always false; I think this was pointed out by
    someone before).
  - Use refactored code from the HTML manager so that the config URL is null
    if there's no context file.
  
  Revision  Changes    Path
  1.7       +32 -12    
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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ManagerServlet.java       25 Jul 2003 16:40:55 -0000      1.6
  +++ ManagerServlet.java       6 Aug 2003 17:50:21 -0000       1.7
  @@ -353,7 +353,7 @@
           boolean update = false;
           if ((request.getParameter("update") != null) 
               && (request.getParameter("update").equals("true"))) {
  -            update = false;
  +            update = true;
           }
   
           // Prepare our output writer to generate the response message
  @@ -435,7 +435,7 @@
           boolean update = false;
           if ((request.getParameter("update") != null) 
               && (request.getParameter("update").equals("true"))) {
  -            update = false;
  +            update = true;
           }
   
           // Prepare our output writer to generate the response message
  @@ -616,6 +616,18 @@
               localWar = localWarCopy;
           }
   
  +        String war = null;
  +        try {
  +            URL url = localWar.toURL();
  +            war = url.toString();
  +            war = "jar:" + war + "!/";
  +        } catch(MalformedURLException e) {
  +            log("managerServlet.badUrl[" + displayPath + "]", e);
  +            writer.println(sm.getString("managerServlet.exception",
  +                                        e.toString()));
  +            return;
  +        }
  +
           // Extract the nested context deployment file (if any)
           File localXml = new File(configBase, basename + ".xml");
           if (debug >= 2) {
  @@ -629,14 +641,21 @@
                                           e.toString()));
               return;
           }
  +        String config = null;
  +        try {
  +            if (localXml.exists()) {
  +                URL url = localXml.toURL();
  +                config = url.toString();
  +            }
  +        } catch (MalformedURLException e) {
  +            log("managerServlet.badUrl[" + displayPath + "]", e);
  +            writer.println(sm.getString("managerServlet.exception",
  +                                        e.toString()));
  +            return;
  +        }
   
           // Deploy this web application
  -        deploy(writer, localXml.getAbsolutePath(), path, 
  -               localWar.getAbsolutePath(), update);
  -
  -        // Acknowledge successful completion of this deploy command
  -        writer.println(sm.getString("managerServlet.deployed",
  -                                    displayPath));
  +        deploy(writer, config, path, war, update);
   
       }
   
  @@ -792,6 +811,7 @@
                   log("ManagerServlet.configure[" + config + "]", t);
                   writer.println(sm.getString("managerServlet.exception",
                                               t.toString()));
  +                return;
               }
   
           } else {
  
  
  

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

Reply via email to