craigmcc    01/07/17 13:24:18

  Modified:    catalina/src/share/org/apache/catalina/startup
                        Constants.java ContextConfig.java
               catalina/src/share/org/apache/catalina/util/xml
                        XmlMapper.java
  Removed:     catalina/src/conf tld_11.dtd tld_12.dtd web_22.dtd
                        web_23.dtd
  Log:
  Make Catalina dependent on the DTD files inside servlet.jar (built from
  the jakarta-servletapi-4 repository) rather than maintaining its own
  copies, which run the risk of being out of date all the time.
  
  Revision  Changes    Path
  1.4       +12 -8     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Constants.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Constants.java    2000/10/04 02:26:30     1.3
  +++ Constants.java    2001/07/17 20:24:17     1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Constants.java,v
 1.3 2000/10/04 02:26:30 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/10/04 02:26:30 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Constants.java,v
 1.4 2001/07/17 20:24:17 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2001/07/17 20:24:17 $
    *
    * ====================================================================
    *
  @@ -69,7 +69,7 @@
    * String constants for the startup package.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/10/04 02:26:30 $
  + * @version $Revision: 1.4 $ $Date: 2001/07/17 20:24:17 $
    */
   
   public final class Constants {
  @@ -82,21 +82,25 @@
       public static final String TldDtdPublicId_11 =
           "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN";
       public static final String TldDtdResourcePath_11 =
  -        "conf/tld_11.dtd";
  +        //        "conf/tld_11.dtd";
  +        "/javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd";
   
       public static final String TldDtdPublicId_12 =
           "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
       public static final String TldDtdResourcePath_12 =
  -        "conf/tld_12.dtd";
  +        //        "conf/tld_12.dtd";
  +        "/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd";
   
       public static final String WebDtdPublicId_22 =
        "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN";
       public static final String WebDtdResourcePath_22 =
  -     "conf/web_22.dtd";
  +        //   "conf/web_22.dtd";
  +        "/javax/servlet/resources/web-app_2_2.dtd";
   
       public static final String WebDtdPublicId_23 =
        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN";
       public static final String WebDtdResourcePath_23 =
  -     "conf/web_23.dtd";
  +        //   "conf/web_23.dtd";
  +        "/javax/servlet/resources/web-app_2_3.dtd";
   
   }
  
  
  
  1.48      +12 -20    
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
  
  Index: ContextConfig.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- ContextConfig.java        2001/06/19 02:20:32     1.47
  +++ ContextConfig.java        2001/07/17 20:24:17     1.48
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
 1.47 2001/06/19 02:20:32 remm Exp $
  - * $Revision: 1.47 $
  - * $Date: 2001/06/19 02:20:32 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
 1.48 2001/07/17 20:24:17 craigmcc Exp $
  + * $Revision: 1.48 $
  + * $Date: 2001/07/17 20:24:17 $
    *
    * ====================================================================
    *
  @@ -128,7 +128,7 @@
    * of that Context, and the associated defined servlets.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.47 $ $Date: 2001/06/19 02:20:32 $
  + * @version $Revision: 1.48 $ $Date: 2001/07/17 20:24:17 $
    */
   
   public final class ContextConfig
  @@ -422,14 +422,10 @@
           if (debug > 0)
               mapper.setDebug(3);
           mapper.setValidating(true);
  -     File resourceFile = new File(System.getProperty("catalina.home"),
  -                                  Constants.TldDtdResourcePath_11);
  -     mapper.registerDTDFile(Constants.TldDtdPublicId_11,
  -                            resourceFile.toString());
  -     resourceFile = new File(System.getProperty("catalina.home"),
  -                             Constants.TldDtdResourcePath_12);
  -     mapper.registerDTDFile(Constants.TldDtdPublicId_12,
  -                            resourceFile.toString());
  +        mapper.registerDTDRes(Constants.TldDtdPublicId_11,
  +                              Constants.TldDtdResourcePath_11);
  +        mapper.registerDTDRes(Constants.TldDtdPublicId_12,
  +                              Constants.TldDtdResourcePath_12);
   
        mapper.addRule("taglib/listener/listener-class",
                       mapper.methodSetter("addApplicationListener", 0));
  @@ -449,14 +445,10 @@
        if (debug > 0)
            mapper.setDebug(3);
        mapper.setValidating(true);
  -     File resourceFile = new File(System.getProperty("catalina.home"),
  -                                  Constants.WebDtdResourcePath_22);
  -     mapper.registerDTDFile(Constants.WebDtdPublicId_22,
  -                            resourceFile.toString());
  -     resourceFile = new File(System.getProperty("catalina.home"),
  -                             Constants.WebDtdResourcePath_23);
  -     mapper.registerDTDFile(Constants.WebDtdPublicId_23,
  -                            resourceFile.toString());
  +        mapper.registerDTDRes(Constants.WebDtdPublicId_22,
  +                              Constants.WebDtdResourcePath_22);
  +        mapper.registerDTDRes(Constants.WebDtdPublicId_23,
  +                              Constants.WebDtdResourcePath_23);
   
           mapper.addRule("web-app",
                          new SetPublicIdAction("setPublicId"));
  
  
  
  1.7       +6 -1      
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/xml/XmlMapper.java
  
  Index: XmlMapper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/xml/XmlMapper.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XmlMapper.java    2001/05/23 22:19:49     1.6
  +++ XmlMapper.java    2001/07/17 20:24:18     1.7
  @@ -443,6 +443,8 @@
            File dtdF=new File( dtd );
            if( dtdF.exists() )
                try {
  +                    if (debug >= 1)
  +                        System.out.println("  Using alternate DTD " + dtd);
                    return new InputSource(new FileInputStream(dtdF));
                } catch( FileNotFoundException ex ) {
                }
  @@ -452,8 +454,11 @@
        dtd = (String) resDTDs.get( publicId );
        if( dtd != null ) {
            InputStream is = this.getClass().getResourceAsStream( dtd );
  -         if( is!= null )
  +         if( is!= null ) {
  +                if (debug >= 1)
  +                    System.out.println("  Using alternate DTD " + dtd);
                return new InputSource(is);
  +            }
            System.out.println("XXX resource not found !!! " + dtd);
            System.out.println(this.getClass().getClassLoader().getClass().getName());
        }
  
  
  

Reply via email to