Hi,

the attached patch add support for Web App Deployment Descriptor that
use XML Schema (Servlet 2.4).

Thanks,

-- Jeanfrancois


Index: ContextConfig.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
retrieving revision 1.66
diff -u -r1.66 ContextConfig.java
--- ContextConfig.java  23 Jun 2002 20:35:30 -0000      1.66
+++ ContextConfig.java  30 Jul 2002 20:45:13 -0000
@@ -133,6 +133,7 @@
  * of that Context, and the associated defined servlets.
  *
  * @author Craig R. McClanahan
+ * @author Jean-Francois Arcand
  * @version $Revision: 1.66 $ $Date: 2002/06/23 20:35:30 $
  */
 
@@ -224,7 +225,6 @@
      * @param event The lifecycle event that has occurred
      */
     public void lifecycleEvent(LifecycleEvent event) {
-
         // Identify the context we are associated with
         try {
             context = (Context) event.getLifecycle();
@@ -483,6 +483,14 @@
         url = ContextConfig.class.getResource(Constants.TldDtdResourcePath_12);
         tldDigester.register(Constants.TldDtdPublicId_12,
                              url.toString());
+        
+        url = ContextConfig.class.getResource(Constants.TldSchemaResourcePath_20);
+        
+        // to support servlet.jar that does not contains the schema
+        if (url != null){
+            tldDigester.setSchema(url.toString());
+        }
+        
         tldDigester.addRuleSet(new TldRuleSet());
         return (tldDigester);
 
@@ -494,9 +502,9 @@
      * web application deployment descriptor (web.xml).
      */
     private static Digester createWebDigester() {
-
         URL url = null;
         Digester webDigester = new Digester();
+        webDigester.setNamespaceAware(true);
         webDigester.setValidating(true);
         url = ContextConfig.class.getResource(Constants.WebDtdResourcePath_22);
         webDigester.register(Constants.WebDtdPublicId_22,
@@ -504,11 +512,39 @@
         url = ContextConfig.class.getResource(Constants.WebDtdResourcePath_23);
         webDigester.register(Constants.WebDtdPublicId_23,
                              url.toString());
+        
+        url = ContextConfig.class.getResource(Constants.WebSchemaResourcePath_24);
+        
+        // to support servlet.jar that does not contains the schema
+        if (url != null){
+            webDigester.setSchema(url.toString());
+        }
+        
+        // Add local copy of Servlet 2.4 XML Schema instance.
+        url = ContextConfig.class.getResource(Constants.J2eeSchemaResourcePath_14);
+        webDigester.register(Constants.J2eeSchemaPublicId_14,
+                             url.toString());   
+         
+        url = ContextConfig.class.getResource(Constants.W3cSchemaResourcePath_10);
+        webDigester.register(Constants.W3cSchemaPublicId_10,
+                             url.toString());   
+         
+        url = ContextConfig.class.getResource(Constants.JspSchemaResourcePath_20);
+        webDigester.register(Constants.JspSchemaPublicId_20,
+                             url.toString());           
+
+        url = ContextConfig.class.getResource(Constants.W3cSchemaResourcePath_10);
+        webDigester.register(Constants.W3cSchemaPublicId_10,
+                             url.toString());   
+         
+        url = ContextConfig.class.getResource(Constants.TldSchemaResourcePath_20);
+        webDigester.register(Constants.TldSchemaPublicId_20,
+                             url.toString());    
+        
         webDigester.addRuleSet(new WebRuleSet());
         return (webDigester);
 
     }
-
 
     /**
      * Process the default configuration file, if it exists.
Index: Constants.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Constants.java,v
retrieving revision 1.5
diff -u -r1.5 Constants.java
--- Constants.java      22 Jul 2001 20:25:13 -0000      1.5
+++ Constants.java      30 Jul 2002 20:45:13 -0000
@@ -69,6 +69,7 @@
  * String constants for the startup package.
  *
  * @author Craig R. McClanahan
+ * @author Jean-Francois Arcand
  * @version $Revision: 1.5 $ $Date: 2001/07/22 20:25:13 $
  */
 
@@ -91,6 +92,11 @@
         //        "conf/tld_12.dtd";
         "/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd";
 
+    public static final String TldSchemaPublicId_20 =
+        "web-jsptaglibrary_2_0.xsd";
+    public static final String TldSchemaResourcePath_20 =
+        "/javax/servlet/resources/web-jsptaglibrary_2_0.xsd";
+        
     public static final String WebDtdPublicId_22 =
         "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN";
     public static final String WebDtdResourcePath_22 =
@@ -103,4 +109,24 @@
         //      "conf/web_23.dtd";
         "/javax/servlet/resources/web-app_2_3.dtd";
 
+    public static final String WebSchemaPubliId_24 =
+        "web-app_2_4.xsd";
+    public static final String WebSchemaResourcePath_24 =
+        "/javax/servlet/resources/web-app_2_4.xsd";
+    
+    public static final String J2eeSchemaPublicId_14 =
+        "j2ee_1_4.xsd";
+    public static final String J2eeSchemaResourcePath_14 =
+        "/javax/servlet/resources/j2ee_1_4.xsd";
+
+    public static final String W3cSchemaPublicId_10 =
+        "xml.xsd";
+    public static final String W3cSchemaResourcePath_10 =
+        "/javax/servlet/resources/xml.xsd";
+    
+    public static final String JspSchemaPublicId_20 =
+        "jsp_2_0.xsd";   
+    public static final String JspSchemaResourcePath_20 =
+        "/javax/servlet/resources/jsp_2_0.xsd";    
+   
 }


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

Reply via email to