You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2010/03/09 15:04:59 UTC

svn commit: r920880 - in /tomcat/trunk: java/org/apache/jasper/compiler/Generator.java webapps/docs/config/systemprops.xml

Author: kkolinko
Date: Tue Mar  9 14:04:58 2010
New Revision: 920880

URL: http://svn.apache.org/viewvc?rev=920880&view=rev
Log:
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.

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
    tomcat/trunk/webapps/docs/config/systemprops.xml

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Generator.java?rev=920880&r1=920879&r2=920880&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Generator.java Tue Mar  9 14:04:58 2010
@@ -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<GenBuffer> 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.

Modified: tomcat/trunk/webapps/docs/config/systemprops.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/systemprops.xml?rev=920880&r1=920879&r2=920880&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/systemprops.xml (original)
+++ tomcat/trunk/webapps/docs/config/systemprops.xml Tue Mar  9 14:04:58 2010
@@ -91,6 +91,14 @@
       be used.</p>
     </property>
 
+    <property name="org.apache.jasper.compiler. Generator.STRICT_GET_PROPERTY">
+      <p>If <code>true</code>, the requirement to have the object referenced in
+      <code>jsp:getProperty</code> 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 <code>true</code> will be used.</p>
+    </property>
+
     <property name="org.apache.jasper.compiler. Parser.STRICT_QUOTE_ESCAPING">
       <p>If <code>false</code> the requirements for escaping quotes in JSP
       attributes will be relaxed so that an unescaped quote will not



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