You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2007/01/23 16:12:16 UTC

svn commit: r499048 - /tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Validator.java

Author: remm
Date: Tue Jan 23 07:12:15 2007
New Revision: 499048

URL: http://svn.apache.org/viewvc?view=rev&rev=499048
Log:
- Tags have specific version numbers, so the regular getJspAttribute method shouldn't be used. Another benefit is
  that it avoids parsing EL twice.

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=499048&r1=499047&r2=499048
==============================================================================
--- 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 Jan 23 07:12:15 2007
@@ -1134,11 +1134,31 @@
                                         expectedType = JspUtil.toClass(typeStr,
                                                 loader);
                                     }
-                                    jspAttrs[i] = getJspAttribute(tldAttrs[j],
-                                            attrs.getQName(i), attrs.getURI(i),
-                                            attrs.getLocalName(i), attrs
-                                            .getValue(i), expectedType, n,
-                                            false);
+                                    if (deferred || elExpression) {
+                                        
+                                        validateFunctions(el, n);
+                                        jspAttrs[i] = new Node.JspAttribute(tldAttrs[j],
+                                                attrs.getQName(i), attrs.getURI(i), attrs
+                                                        .getLocalName(i),
+                                                attrs.getValue(i), false, el, false);
+                                        ELContextImpl ctx = new ELContextImpl();
+                                        ctx.setFunctionMapper(getFunctionMapper(el));
+                                        try {
+                                            jspAttrs[i].validateEL(this.pageInfo
+                                                    .getExpressionFactory(), ctx);
+                                        } catch (ELException e) {
+                                            this.err.jspError(n.getStart(),
+                                                    "jsp.error.invalid.expression", attrs.getValue(i), e
+                                                            .toString());
+                                        }
+
+                                    } else {
+                                        jspAttrs[i] = getJspAttribute(tldAttrs[j],
+                                                attrs.getQName(i), attrs.getURI(i),
+                                                attrs.getLocalName(i), attrs
+                                                .getValue(i), expectedType, n,
+                                                false);
+                                    }
                                 } catch (ClassNotFoundException e) {
                                     err.jspError
                                         (n, "jsp.error.unknown_attribute_type",



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