tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context SaveContextAction.java
Date Tue, 27 Apr 2004 20:54:49 GMT
markt       2004/04/27 13:54:48

  Modified:    webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context
                        SaveContextAction.java
  Log:
  - Fix bug 18383. Admin app should set path to "" rather than "/" for a new root context.
    The path in the mbean name still needs to be "/" to prevent naming error.
  - Removed unused imports identified by Eclipse.
  
  Revision  Changes    Path
  1.12      +11 -14    jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/SaveContextAction.java
  
  Index: SaveContextAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/SaveContextAction.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SaveContextAction.java	14 Mar 2003 16:00:16 -0000	1.11
  +++ SaveContextAction.java	27 Apr 2004 20:54:48 -0000	1.12
  @@ -63,17 +63,11 @@
   
   
   import java.net.URLEncoder;
  -import java.util.Iterator;
   import java.util.Locale;
   import java.io.IOException;
   import javax.management.Attribute;
   import javax.management.MBeanServer;
  -import javax.management.MBeanServerFactory;
  -import javax.management.QueryExp;
  -import javax.management.Query;
  -import javax.management.ObjectInstance;
   import javax.management.ObjectName;
  -import javax.management.JMException;
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
  @@ -185,10 +179,13 @@
           String cObjectName = cform.getObjectName();
           String lObjectName = cform.getLoaderObjectName();
           String mObjectName = cform.getManagerObjectName();
  +        String oNamePath = "";
           if ((cform.getPath() == null) || (cform.getPath().length()<1)) {
  -            cform.setPath("/");
  +            oNamePath = ("/");
  +        } else {
  +            oNamePath = cform.getPath();
           }
  -       
  +
           // Perform a "Create Context" transaction (if requested)
           if ("Create".equals(adminAction)) {
   
  @@ -203,7 +200,7 @@
                   // Ensure that the requested context name is unique
                   ObjectName oname =
                       new ObjectName(TomcatTreeBuilder.CONTEXT_TYPE +
  -                                   ",path=" + cform.getPath() +
  +                                   ",path=" + oNamePath +
                                      ",host=" + honame.getKeyProperty("host") +
                                      ",service=" + honame.getKeyProperty("service"));
                   
  @@ -222,7 +219,7 @@
                   // Create a new StandardContext object
                   values = new Object[3];
                   values[0] = parentName;
  -                values[1] = cform.getPath();
  +                values[1] = oNamePath;
                   values[2] = cform.getDocBase();
   
                   operation = "createStandardContext";    
  
  
  

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


Mime
View raw message