- Tags have specific version numbers, so the regular getJspAttribute method shouldn...
authorremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 23 Jan 2007 15:12:15 +0000 (15:12 +0000)
committerremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 23 Jan 2007 15:12:15 +0000 (15:12 +0000)
  that it avoids parsing EL twice.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@499048 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/jasper/compiler/Validator.java

index 5ce835e..13819f1 100644 (file)
@@ -1134,11 +1134,31 @@ class Validator {
                                         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",