Author: remm
Date: Tue Oct 31 06:27:22 2006
New Revision: 469498

URL: http://svn.apache.org/viewvc?view=rev&rev=469498
Log:
- Taglibs have their own version number, so isExpression gets an adjustment 
allowing not checking for deferred
  expressions.

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Validator.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Validator.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Validator.java?view=diff&rev=469498&r1=469497&r2=469498
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Validator.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Validator.java Tue Oct 
31 06:27:22 2006
@@ -1008,8 +1008,9 @@
                         } else {
                             // Attribute does not accept any expressions.
                             // Make sure its value does not contain any.
-                            if (isExpression(n, attrs.getValue(i))) {
-                                err .jspError(n, 
"jsp.error.attribute.custom.non_rt_with_expr",
+                            if (isExpression(n, attrs.getValue(i), 
+                                    
!tagInfo.getTagLibrary().getRequiredVersion().equals("2.0"))) {
+                                err.jspError(n, 
"jsp.error.attribute.custom.non_rt_with_expr",
                                                 tldAttrs[j].getName());
                             }
                             jspAttrs[i] = new Node.JspAttribute(tldAttrs[j],
@@ -1193,11 +1194,11 @@
          * Checks to see if the given attribute value represents a runtime or 
EL
          * expression.
          */
-        private boolean isExpression(Node n, String value) {
+        private boolean isExpression(Node n, String value, boolean 
checkDeferred) {
             if ((n.getRoot().isXmlSyntax() && value.startsWith("%="))
                     || (!n.getRoot().isXmlSyntax() && value.startsWith("<%="))
                     || (value.indexOf("${") != -1 && !pageInfo.isELIgnored())
-                    || (value.indexOf("#{") != -1 && !pageInfo.isELIgnored()
+                    || (checkDeferred && value.indexOf("#{") != -1 && 
!pageInfo.isELIgnored()
                             && !pageInfo.isDeferredSyntaxAllowedAsLiteral()))
                 return true;
             else
@@ -1213,7 +1214,7 @@
                 String actionName) throws JasperException {
             if (n.getAttributes() != null
                     && n.getAttributes().getValue(attrName) != null
-                    && isExpression(n, n.getAttributes().getValue(attrName))) {
+                    && isExpression(n, n.getAttributes().getValue(attrName), 
true)) {
                 err.jspError(n,
                         "jsp.error.attribute.standard.non_rt_with_expr",
                         attrName, actionName);



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

Reply via email to