tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfarc...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHost.java
Date Mon, 06 Oct 2003 23:51:46 GMT
jfarcand    2003/10/06 16:51:46

  Modified:    catalina/src/share/org/apache/catalina/util
                        SchemaResolver.java
               catalina/src/share/org/apache/catalina/startup
                        ContextConfig.java TldConfig.java
               catalina/src/share/org/apache/catalina/core
                        StandardHost.java
  Log:
  Cleanup schema validation and add a status message at startup.
  
  Revision  Changes    Path
  1.2       +2 -9      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/SchemaResolver.java
  
  Index: SchemaResolver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/SchemaResolver.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SchemaResolver.java	20 Aug 2002 03:26:37 -0000	1.1
  +++ SchemaResolver.java	6 Oct 2003 23:51:46 -0000	1.2
  @@ -101,18 +101,11 @@
   
   
       /**
  -     * The XML schema to use for validating an XML instance.
  -     */
  -    protected String schemaLocation = null;
  -
  -
  -    /**
        * Create a new <code>EntityResolver</code> that will redirect
        * all remote dtds and schema to a locat destination.
        * @param schemaLocation the XML Schema used to validate xml instance.
        */
  -    public SchemaResolver(String schemaLocation, Digester digester) {
  -        this.schemaLocation = schemaLocation;
  +    public SchemaResolver(Digester digester) {
           this.digester = digester;
       }
   
  @@ -162,7 +155,7 @@
   
           // Redirect the schema location to a local destination
           String key = null;
  -        if (schemaLocation != null && entityURL == null && systemId !=
null) {
  +        if (entityURL == null && systemId != null) {
               key = systemId.substring(systemId.lastIndexOf('/')+1);
               entityURL = (String)entityValidator.get(key);
           }
  
  
  
  1.37      +4 -7      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.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- ContextConfig.java	25 Sep 2003 19:27:59 -0000	1.36
  +++ ContextConfig.java	6 Oct 2003 23:51:46 -0000	1.37
  @@ -493,15 +493,12 @@
           webDigester.setNamespaceAware(namespaceAware);
           webDigester.setValidating(validation);
          
  -        if (webDigester.getFactory().getClass().getName().indexOf("xerces")!=-1) {
  +        if (webDigester.getFactory().getClass()
  +                .getName().indexOf("xerces")!=-1) {
               webDigester = patchXerces(webDigester);
           }
  -        
  -        url = ContextConfig.class.
  -                    getResource(Constants.WebSchemaResourcePath_24);
   
  -        SchemaResolver webEntityResolver = new SchemaResolver(url.toString(),
  -                                                              webDigester);
  +        SchemaResolver webEntityResolver = new SchemaResolver( webDigester);
   
           if (validation) {
               if (webDigester.getFactory().getClass()
  
  
  
  1.32      +3 -4      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/TldConfig.java
  
  Index: TldConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/TldConfig.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- TldConfig.java	26 Sep 2003 23:09:08 -0000	1.31
  +++ TldConfig.java	6 Oct 2003 23:51:46 -0000	1.32
  @@ -457,13 +457,12 @@
           tldDigester.setNamespaceAware(xmlNamespaceAware);
           tldDigester.setValidating(xmlValidation);
           
  -        if (tldDigester.getFactory().getClass().getName().indexOf("xerces")!=-1) {
  +        if (tldDigester.getFactory().getClass()
  +                    .getName().indexOf("xerces")!=-1) {
               tldDigester = patchXerces(tldDigester);
           }
           // Set the schemaLocation
  -        url = TldConfig.class.getResource(Constants.TldSchemaResourcePath_20);
  -        SchemaResolver tldEntityResolver = new SchemaResolver(url.toString(), 
  -                                                              tldDigester);
  +        SchemaResolver tldEntityResolver = new SchemaResolver( tldDigester);
   
           if (xmlValidation) {
               if (tldDigester.getFactory().getClass()
  
  
  
  1.23      +8 -1      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- StandardHost.java	2 Sep 2003 21:22:04 -0000	1.22
  +++ StandardHost.java	6 Oct 2003 23:51:46 -0000	1.23
  @@ -507,7 +507,9 @@
        * @param xmlValidation true to enable xml instance validation
        */
       public void setXmlValidation(boolean xmlValidation){
  +        
           this.xmlValidation = xmlValidation;
  +
       }
   
       /**
  @@ -788,6 +790,11 @@
                        errorReportValveClass));
               }
           }
  +
  +        if (xmlValidation)
  +            log.info( "XML validation enaled ");
  +        else
  +            log.info( "XML validation disabled ");
   
           super.start();
   
  
  
  

---------------------------------------------------------------------
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