From: kkolinko Date: Tue, 9 Mar 2010 14:04:58 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48701 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=267f144590ea4467750c5a81247b1e80436d0ff3;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48701 Add a system property to allow disabling enforcement of a requirement of JSP.5.3. The specification recommends, but does not require us to enforce it. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@920880 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/jasper/compiler/Generator.java b/java/org/apache/jasper/compiler/Generator.java index ecbb9460b..d761cf6e6 100644 --- a/java/org/apache/jasper/compiler/Generator.java +++ b/java/org/apache/jasper/compiler/Generator.java @@ -78,6 +78,15 @@ class Generator { private static final String VAR_INSTANCEMANAGER = System.getProperty("org.apache.jasper.compiler.Generator.VAR_INSTANCEMANAGER", "_jsp_instancemanager"); + /* System property that controls if the requirement to have the object + * used in jsp:getProperty action to be previously "introduced" + * to the JSP processor (see JSP.5.3) is enforced. + */ + private static final boolean STRICT_GET_PROPERTY = Boolean.valueOf( + System.getProperty( + "org.apache.jasper.compiler.Generator.STRICT_GET_PROPERTY", + "true")).booleanValue(); + private ServletWriter out; private ArrayList methodsBuffered; @@ -1058,7 +1067,7 @@ class Generator { + ")_jspx_page_context.findAttribute(" + "\"" + name + "\"))." + methodName + "())));"); - } else if (varInfoNames.contains(name)) { + } else if (!STRICT_GET_PROPERTY || varInfoNames.contains(name)) { // The object is a custom action with an associated // VariableInfo entry for this name. // Get the class name and then introspect at runtime. diff --git a/webapps/docs/config/systemprops.xml b/webapps/docs/config/systemprops.xml index aa6571ac3..8eabe30a3 100644 --- a/webapps/docs/config/systemprops.xml +++ b/webapps/docs/config/systemprops.xml @@ -91,6 +91,14 @@ be used.

+ +

If true, the requirement to have the object referenced in + jsp:getProperty action to be previously "introduced" + to the JSP processor, as specified in the chapter JSP.5.3 of JSP 2.0 and + later specifications, is enforced. If not specified, the specification + compliant default of true will be used.

+
+

If false the requirements for escaping quotes in JSP attributes will be relaxed so that an unescaped quote will not