tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1559708 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/jasper/compiler/ELParser.java java/org/apache/jasper/resources/LocalStrings.properties test/org/apache/el/TestELInJsp.java test/webapp-3.0/bug5nnnn/bug56029.jspx
Date Mon, 20 Jan 2014 14:30:49 GMT
Author: markt
Date: Mon Jan 20 14:30:48 2014
New Revision: 1559708

URL: http://svn.apache.org/r1559708
Log:
Additional fix for bug 56029. Now whitespace is not skipped, make sure it is trimmed before
the function name is used.
Includes a test case based on a jspx file by kkolinko.

Added:
    tomcat/tc7.0.x/trunk/test/webapp-3.0/bug5nnnn/bug56029.jspx
      - copied unchanged from r1559707, tomcat/trunk/test/webapp/bug5nnnn/bug56029.jspx
Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELParser.java
    tomcat/tc7.0.x/trunk/java/org/apache/jasper/resources/LocalStrings.properties
    tomcat/tc7.0.x/trunk/test/org/apache/el/TestELInJsp.java

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1559707

Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELParser.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELParser.java?rev=1559708&r1=1559707&r2=1559708&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELParser.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELParser.java Mon Jan 20 14:30:48
2014
@@ -163,7 +163,7 @@ public class ELParser {
                 }
             }
             if (curToken.toChar() == '(') {
-                ELexpr.add(new ELNode.Function(s1, s2));
+                ELexpr.add(new ELNode.Function(s1.trim(), s2.trim()));
                 return true;
             }
             curToken = original;

Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/resources/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/resources/LocalStrings.properties?rev=1559708&r1=1559707&r2=1559708&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/jasper/resources/LocalStrings.properties (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/resources/LocalStrings.properties Mon Jan
20 14:30:48 2014
@@ -433,7 +433,7 @@ jsp.error.attributes.not.allowed = {0} m
 jsp.error.tagfile.badSuffix=Missing \".tag\" suffix in tag file path {0}
 jsp.error.tagfile.illegalPath=Illegal tag file path: {0}, must start with \"/WEB-INF/tags\"
or \"/META-INF/tags\"
 jsp.error.plugin.wrongRootElement=Name of root element in {0} different from {1}
-jsp.error.attribute.invalidPrefix=The attribute prefix {0} does not correspond to any imported
tag library
+jsp.error.attribute.invalidPrefix=The attribute prefix [{0}] does not correspond to any imported
tag library
 jsp.error.nested.jspattribute=A jsp:attribute standard action cannot be nested within another
jsp:attribute standard action
 jsp.error.nested.jspbody=A jsp:body standard action cannot be nested within another jsp:body
or jsp:attribute standard action
 jsp.error.variable.either.name=Either name-given or name-from-attribute attribute must be
specified in a variable directive

Modified: tomcat/tc7.0.x/trunk/test/org/apache/el/TestELInJsp.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/el/TestELInJsp.java?rev=1559708&r1=1559707&r2=1559708&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/el/TestELInJsp.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/el/TestELInJsp.java Mon Jan 20 14:30:48 2014
@@ -14,15 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.el;
 
 import java.io.File;
 
 import static org.junit.Assert.assertTrue;
 
+import org.junit.Assert;
 import org.junit.Test;
 
+import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
 import org.apache.tomcat.util.buf.ByteChunk;
@@ -440,6 +441,30 @@ public class TestELInJsp extends TomcatB
         assertEcho(result, "05-Hello JUnit from Tomcat");
     }
 
+    @Test
+    public void testBug56029() throws Exception {
+        Tomcat tomcat = getTomcatInstance();
+
+        File appDir = new File("test/webapp-3.0");
+        // app dir is relative to server home
+        StandardContext ctxt = (StandardContext) tomcat.addWebapp(
+                null, "/test", appDir.getAbsolutePath());
+
+        // This test needs the JSTL libraries
+        File lib = new File("webapps/examples/WEB-INF/lib");
+        ctxt.setAliases("/WEB-INF/lib=" + lib.getCanonicalPath());
+
+        tomcat.start();
+
+        ByteChunk res = getUrl("http://localhost:" + getPort() +
+                "/test/bug5nnnn/bug56029.jspx");
+
+        String result = res.toString();
+
+        Assert.assertTrue(result.contains("[1]"));
+    }
+
+
     // Assertion for text contained with <p></p>, e.g. printed by tags:echo
     private static void assertEcho(String result, String expected) {
         assertTrue(result.indexOf("<p>" + expected + "</p>") > 0);



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


Mime
View raw message