amyroh      2003/01/29 15:02:38

  Modified:    catalina/src/share/org/apache/catalina/startup
                        ContextConfig.java
  Log:
  Fix bugzilla  7564 - Avoid hardcoding the default deployment descriptor location.
  
  Revision  Changes    Path
  1.18      +35 -6     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
  
  Index: ContextConfig.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- ContextConfig.java        16 Jan 2003 21:44:17 -0000      1.17
  +++ ContextConfig.java        29 Jan 2003 23:02:38 -0000      1.18
  @@ -165,7 +165,13 @@
        */
       private int debug = 0;
   
  -
  +    
  +    /**
  +     * The default web application's deployment descriptor location.
  +     */
  +    private String defaultWebXml = Constants.DefaultWebXml;
  +    
  +    
       /**
        * Track any fatal errors during startup configuration processing.
        */
  @@ -202,7 +208,7 @@
        */
       private static boolean xmlNamespaceAware = false;
   
  -    
  +        
       // ------------------------------------------------------------- Properties
   
   
  @@ -226,6 +232,28 @@
           this.debug = debug;
   
       }
  +    
  +    
  +    /**
  +     * Return the location of the default deployment descriptor
  +     */
  +    public String getDefaultWebXml() {
  +
  +        return (this.defaultWebXml);
  +
  +    }
  +
  +
  +    /**
  +     * Set the location of the default deployment descriptor
  +     *
  +     * @param path Absolute/relative path to the default web.xml
  +     */
  +    public void setDefaultWebXml(String path) {
  +
  +        this.defaultWebXml = path;
  +
  +    }
   
   
       // --------------------------------------------------------- Public Methods
  @@ -603,10 +631,11 @@
           long t1=System.currentTimeMillis();
   
           // Open the default web.xml file, if it exists
  -        File file = new File(Constants.DefaultWebXml);
  -        if (!file.isAbsolute())
  +        File file = new File(this.defaultWebXml);
  +        if (!file.isAbsolute()) {
               file = new File(System.getProperty("catalina.base"),
  -                            Constants.DefaultWebXml);
  +                            this.defaultWebXml);
  +        }
           FileInputStream stream = null;
           try {
               stream = new FileInputStream(file.getCanonicalPath());
  
  
  

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

Reply via email to