tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r893617 - in /tomcat/trunk/java/org/apache/jasper/compiler: Generator.java Node.java Validator.java
Date Wed, 23 Dec 2009 20:05:25 GMT
Author: markt
Date: Wed Dec 23 20:05:25 2009
New Revision: 893617

URL: http://svn.apache.org/viewvc?rev=893617&view=rev
Log:
JSP 2.2 - Add omit attribute to <jsp:attribute>

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
    tomcat/trunk/java/org/apache/jasper/compiler/Node.java
    tomcat/trunk/java/org/apache/jasper/compiler/Validator.java

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Generator.java?rev=893617&r1=893616&r2=893617&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Generator.java Wed Dec 23 20:05:25 2009
@@ -1950,6 +1950,10 @@
             for (int i = 0; attrs != null && i < attrs.length; i++) {
                 String attrStr = null;
                 if (attrs[i].isNamedAttribute()) {
+                    if (attrs[i].getNamedAttributeNode().isOmit()) {
+                        // Skip this attribute - JSP.5-7
+                        continue;
+                    }
                     attrStr = generateNamedAttributeValue(attrs[i]
                             .getNamedAttributeNode());
                 } else {

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Node.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Node.java?rev=893617&r1=893616&r2=893617&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Node.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Node.java Wed Dec 23 20:05:25 2009
@@ -1864,6 +1864,10 @@
         // True if this node is to be trimmed, or false otherwise
         private boolean trim = true;
 
+        // True if this attribute should be omitted from the output if
+        // used with a <jsp:element>, otherwise false
+        private boolean omit = false;
+
         private ChildInfo childInfo;
 
         private String name;
@@ -1886,6 +1890,10 @@
                 // (if null or true, leave default of true)
                 trim = false;
             }
+            if ("true".equals(this.getAttributeValue("omit"))) {
+                // (if null or false, leave default of false)
+                omit = true;
+            }
             childInfo = new ChildInfo();
             name = this.getAttributeValue("name");
             if (name != null) {
@@ -1925,6 +1933,10 @@
             return trim;
         }
 
+        public boolean isOmit() {
+            return omit;
+        }
+
         /**
          * @return A unique temporary variable name to store the result in.
          *         (this probably could go elsewhere, but it's convenient here)

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Validator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Validator.java?rev=893617&r1=893616&r2=893617&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Validator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Validator.java Wed Dec 23 20:05:25 2009
@@ -482,7 +482,8 @@
 
         private static final JspUtil.ValidAttribute[] attributeAttrs = {
                 new JspUtil.ValidAttribute("name", true),
-                new JspUtil.ValidAttribute("trim") };
+                new JspUtil.ValidAttribute("trim"),
+                new JspUtil.ValidAttribute("omit")};
 
         private static final JspUtil.ValidAttribute[] invokeAttrs = {
                 new JspUtil.ValidAttribute("fragment", true),



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


Mime
View raw message