You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ru...@locus.apache.org on 2000/02/27 04:07:50 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/context DefaultCMSetter.java WebXmlReader.java

rubys       00/02/26 19:07:50

  Modified:    src/share/org/apache/tomcat/context DefaultCMSetter.java
                        WebXmlReader.java
  Log:
  Respect tomcat.home
  
  Revision  Changes    Path
  1.19      +5 -0      jakarta-tomcat/src/share/org/apache/tomcat/context/DefaultCMSetter.java
  
  Index: DefaultCMSetter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/DefaultCMSetter.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- DefaultCMSetter.java	2000/02/26 19:41:42	1.18
  +++ DefaultCMSetter.java	2000/02/27 03:07:49	1.19
  @@ -158,6 +158,11 @@
   
   	String base = context.getDocBase();
   	File dir = new File(base + "/WEB-INF/classes");
  +        if (!dir.isAbsolute()) {
  +            // evaluate repository path relative to the context's home directory
  +            ContextManager cm = context.getContextManager();
  +	    dir = new File(cm.getHome(), base + "/WEB-INF/classes");
  +        }
   	loader.addRepository( dir );
   
   	File f =  new File(base + "/WEB-INF/lib");
  
  
  
  1.14      +8 -4      jakarta-tomcat/src/share/org/apache/tomcat/context/WebXmlReader.java
  
  Index: WebXmlReader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/WebXmlReader.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- WebXmlReader.java	2000/02/22 21:44:28	1.13
  +++ WebXmlReader.java	2000/02/27 03:07:49	1.14
  @@ -30,8 +30,12 @@
   
   	// read default web.xml
   	try {
  -	    processFile(ctx, ctx.getContextManager().getHome() + "/conf/web.xml");
  -	    processFile(ctx, ctx.getDocBase() + "/WEB-INF/web.xml");
  +            String home = ctx.getContextManager().getHome();
  +	    processFile(ctx, home + "/conf/web.xml");
  +            File inf_xml = new File(ctx.getDocBase() + "/WEB-INF/web.xml");
  +            if (!inf_xml.isAbsolute())
  +                inf_xml = new File(home, inf_xml.toString());
  +	    processFile(ctx, inf_xml.toString());
   	    XmlMapper xh=new XmlMapper();
   	} catch (Exception e) {
   	    String msg = sm.getString("context.getConfig.e",ctx.getPath() + " " + ctx.getDocBase());
  @@ -42,9 +46,9 @@
   
       void processFile( Context ctx, String file) {
   	try {
  -	    File f=new File(file);
  +	    File f=new File(FileUtil.patch(file));
   	    if( ! f.exists() ) {
  -		ctx.log( "File not found, using defaults " + file );
  +		ctx.log( "File not found, using defaults " + f );
   		return;
   	    }
   	    if( ctx.getDebug() > 0 ) ctx.log("Reading " + file );