tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amy...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup WebRuleSet.java
Date Wed, 07 Aug 2002 22:55:22 GMT
amyroh      2002/08/07 15:55:21

  Modified:    catalina/src/share/org/apache/catalina/startup
                        WebRuleSet.java
  Log:
  Add a rule for new Servlet 2.4's ability to extend the deployment descriptor
  <deployment-extention>.
  
  Revision  Changes    Path
  1.2       +37 -4     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/WebRuleSet.java
  
  Index: WebRuleSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/WebRuleSet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebRuleSet.java	18 Jul 2002 16:47:48 -0000	1.1
  +++ WebRuleSet.java	7 Aug 2002 22:55:21 -0000	1.2
  @@ -145,6 +145,9 @@
           digester.addCallParam(prefix + "web-app/context-param/param-name", 0);
           digester.addCallParam(prefix + "web-app/context-param/param-value", 1);
   
  +        digester.addRule(prefix + "web-app/deployment-extension",
  +                         new SetDeploymentExtensionRule(digester));
  +
           digester.addCallMethod(prefix + "web-app/display-name",
                                  "setDisplayName", 0);
   
  @@ -337,6 +340,9 @@
                               "addChild",
                               "org.apache.catalina.Container");
   
  +        digester.addRule(prefix + "web-app/servlet/deployment-extension",
  +                         new SetDeploymentExtensionRule(digester));
  +
           digester.addCallMethod(prefix + "web-app/servlet/init-param",
                                  "addInitParameter", 2);
           digester.addCallParam(prefix + "web-app/servlet/init-param/param-name",
  @@ -406,6 +412,33 @@
           securityConstraint.setAuthConstraint(true);
           if (digester.getDebug() > 0)
               digester.log("Calling SecurityConstraint.setAuthConstraint(true)");
  +    }
  +
  +}
  +
  +
  +/**
  + * A Rule that checks mustUnderstand attribute.  It throws an Exception if
  + * mustUnderstand attribute is true since stand-alone Tomcat currently does
  + * not have a way of recognizing an extension within a deployment descriptor.
  + */
  +
  +final class SetDeploymentExtensionRule extends Rule {
  +
  +    public SetDeploymentExtensionRule(Digester digester) {
  +        super(digester);
  +    }
  +
  +    public void begin(Attributes attributes) throws Exception {
  +        String mustUnderstand = attributes.getValue("mustUnderstand");
  +        if ((mustUnderstand != null) && (mustUnderstand.equals("true"))) {
  +            if (digester.getDebug() > 0) {
  +                digester.log("Exception in SetDeploymentExtensionRule");
  +            }
  +            throw new Exception(
  +            "deployment-extension attribute mustUnderstand is set to true");
  +        }
  +
       }
   
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message