nacho 00/11/01 16:43:48 Modified: src/share/org/apache/tomcat/context AutoSetup.java Log: Adapting code to new start order. Revision Changes Path 1.18 +15 -19 jakarta-tomcat/src/share/org/apache/tomcat/context/AutoSetup.java Index: AutoSetup.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/AutoSetup.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- AutoSetup.java 2000/09/29 21:09:19 1.17 +++ AutoSetup.java 2000/11/02 00:43:48 1.18 @@ -83,23 +83,6 @@ public AutoSetup() { } - /** Take note of the added contexts. - * We can enhance the auto-setup for virtual hosts too, - * but it's up to this class how it deals with that and - * existing contexts. - */ - public void addContext(ContextManager cm, Context ctx) - throws TomcatException - { - if( ctx.getHost()== null ) { - // this is a context that goes into the default server - // we care only about the root context for autosetup - // until we define a pattern for automatic vhost setup. - definedContexts.put( ctx.getPath(), ctx ); - if(debug>0) log("Register explicit context " + ctx.getPath()); - } - } - /** This will add all contexts to the default host. * We need a mechanism ( or convention ) to configure * virtual hosts too @@ -112,7 +95,19 @@ log("No webapps/ directory " + webappD ); return ; // nothing to set up } - + + Enumeration en=cm.getContexts(); + while (en.hasMoreElements()){ + Context ctx=(Context)en.nextElement(); + if( ctx.getHost()== null ) { + // this is a context that goes into the default server + // we care only about the root context for autosetup + // until we define a pattern for automatic vhost setup. + definedContexts.put( ctx.getPath(), ctx ); + if(debug>0) log("Register explicit context " + ctx.getPath()); + } + } + String[] list = webappD.list(); if( list.length==0 ) { log("No apps in webapps/ "); @@ -123,7 +118,7 @@ String fname=name.substring(0, name.length()-4); File appDir=new File( home + "/webapps/" + fname); if( ! appDir.exists() ) { - // no check if war file is "newer" than directory + // no check if war file is "newer" than directory // To update you need to "remove" the context first!!! appDir.mkdirs(); // Expand war file @@ -163,6 +158,7 @@ Context ctx=new Context(); ctx.setContextManager( cm ); ctx.setPath(path); + definedContexts.put( path, ctx ); // use absolute filename based on CM home instead of relative // don't assume HOME==TOMCAT_HOME ctx.setDocBase( f.getAbsolutePath() ); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]