tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/admin/WEB-INF/classes/tadm TomcatAdmin.java
Date Mon, 02 Oct 2000 02:04:37 GMT
costin      00/10/01 19:04:36

  Modified:    src/admin/WEB-INF/classes ContextAdmin.java
               src/admin/WEB-INF/classes/tadm TomcatAdmin.java
  Log:
  Fixed the build.
  
  Revision  Changes    Path
  1.8       +13 -11    jakarta-tomcat/src/admin/WEB-INF/classes/ContextAdmin.java
  
  Index: ContextAdmin.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/admin/WEB-INF/classes/ContextAdmin.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ContextAdmin.java	2000/09/28 03:25:41	1.7
  +++ ContextAdmin.java	2000/10/02 02:04:36	1.8
  @@ -49,18 +49,20 @@
   	cm = realRequest.getContext().getContextManager();
       }
   
  -    public Enumeration getContextNames() {
  -        return (Enumeration) cm.getContextNames();
  -    }
  -
       public String[] getContextInfo(String contextName) {
   	Enumeration enum;
   	String key;
  -        Context context;
  +        Context context=null;
           Vector v = new Vector();
  -
   
  -	context = cm.getContext(contextName);
  +	enum=cm.getContexts();
  +	while( enum.hasMoreElements() ) {
  +	    Context ctx=(Context)enum.nextElement();
  +	    if( contextName.equals ( context.getPath() )) {
  +		context=ctx;
  +		break;
  +	    }
  +	}
   
   	v.addElement("DOC BASE: " + context.getDocBase());
   	v.addElement("FULL DOC BASE: " + context.getAbsolutePath());
  @@ -113,12 +115,12 @@
   
       public String removeContext() {
           if (removeContextName != null) {
  -            Enumeration enum = cm.getContextNames();
  +            Enumeration enum = cm.getContexts();
               while (enum.hasMoreElements()) {
  -	        String name = (String)enum.nextElement();
  -		if (removeContextName.equals(name)) {
  +	        Context ctx = (Context)enum.nextElement();
  +		if (removeContextName.equals(ctx.getPath())) {
   	            try {
  -		        cm.removeContext(removeContextName);
  +		        cm.removeContext(ctx);
   		    }
   	            catch(org.apache.tomcat.core.TomcatException ex) {
   	                ex.printStackTrace();
  
  
  
  1.4       +8 -2      jakarta-tomcat/src/admin/WEB-INF/classes/tadm/TomcatAdmin.java
  
  Index: TomcatAdmin.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/admin/WEB-INF/classes/tadm/TomcatAdmin.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TomcatAdmin.java	2000/09/28 03:25:41	1.3
  +++ TomcatAdmin.java	2000/10/02 02:04:36	1.4
  @@ -35,8 +35,14 @@
   		ctxPath=req.getParameter( ctxPathParam );
   	    }
   	    if( ctxPath != null ) {
  -		Context ctx=cm.getContext( ctxPath );
  -		pageContext.setAttribute("ctx", ctx);
  +		Enumeration en=cm.getContexts();
  +		while( en.hasMoreElements() ) {
  +		    Context ctx=(Context)en.nextElement();
  +		    if( ctxPath.equals( ctx.getPath())) {
  +			pageContext.setAttribute("ctx", ctx);
  +			break;
  +		    }
  +		}
   	    }
   	} catch (Exception ex ) {
   	    ex.printStackTrace();
  
  
  

Mime
View raw message