From 4875f5bdd3bf16b7fd59a71da3a20d29d24bbd3b Mon Sep 17 00:00:00 2001 From: remm Date: Tue, 31 Oct 2006 14:27:22 +0000 Subject: [PATCH] - Taglibs have their own version number, so isExpression gets an adjustment allowing not checking for deferred expressions. git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@469498 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/jasper/compiler/Validator.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/java/org/apache/jasper/compiler/Validator.java b/java/org/apache/jasper/compiler/Validator.java index 696b206c9..1e17f6cd4 100644 --- a/java/org/apache/jasper/compiler/Validator.java +++ b/java/org/apache/jasper/compiler/Validator.java @@ -1008,8 +1008,9 @@ class Validator { } 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 @@ class Validator { * 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 @@ class Validator { 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); -- 2.11.0