You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/11/19 19:21:30 UTC

svn commit: r1036969 - in /tomcat/trunk: java/org/apache/jasper/compiler/Parser.java test/org/apache/jasper/compiler/TestParser.java test/webapp-3.0/WEB-INF/tags/bug49297.tag test/webapp-3.0/bug49nnn/bug49297Tag.jsp

Author: markt
Date: Fri Nov 19 18:21:29 2010
New Revision: 1036969

URL: http://svn.apache.org/viewvc?rev=1036969&view=rev
Log:
Additional fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=49297
Handle tag directives in a similar manner to page directives

Added:
    tomcat/trunk/test/webapp-3.0/WEB-INF/tags/bug49297.tag
    tomcat/trunk/test/webapp-3.0/bug49nnn/bug49297Tag.jsp   (with props)
Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/Parser.java
    tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Parser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Parser.java?rev=1036969&r1=1036968&r2=1036969&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Parser.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Parser.java Fri Nov 19 18:21:29 2010
@@ -572,7 +572,7 @@ class Parser implements TagConstants {
      * Attribute)*
      */
     private void parseTagDirective(Node parent) throws JasperException {
-        Attributes attrs = parseAttributes();
+        Attributes attrs = parseAttributes(true);
         Node.TagDirective n = new Node.TagDirective(attrs, start, parent);
 
         /*

Modified: tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java?rev=1036969&r1=1036968&r2=1036969&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java (original)
+++ tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java Fri Nov 19 18:21:29 2010
@@ -254,6 +254,25 @@ public class TestParser extends TomcatBa
         assertEquals(500, sc);
     }
 
+    public void testBug49297Tag() throws Exception {
+
+        Tomcat tomcat = getTomcatInstance();
+
+        File appDir = new File("test/webapp-3.0");
+        // app dir is relative to server home
+        tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
+        
+        tomcat.start();
+
+        ByteChunk res = new ByteChunk();
+        int sc = getUrl("http://localhost:" + getPort() +
+                "/test/bug49nnn/bug49297Tag.jsp", res,
+                new HashMap<String,List<String>>());
+
+        assertEquals(200, sc);
+        assertEcho(res.toString(), "OK");
+    }
+
     /** Assertion for text printed by tags:echo */
     private static void assertEcho(String result, String expected) {
         assertTrue(result.indexOf("<p>" + expected + "</p>") > 0);

Added: tomcat/trunk/test/webapp-3.0/WEB-INF/tags/bug49297.tag
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0/WEB-INF/tags/bug49297.tag?rev=1036969&view=auto
==============================================================================
--- tomcat/trunk/test/webapp-3.0/WEB-INF/tags/bug49297.tag (added)
+++ tomcat/trunk/test/webapp-3.0/WEB-INF/tags/bug49297.tag Fri Nov 19 18:21:29 2010
@@ -0,0 +1,21 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+--%><%@ tag import="java.util.List" import="java.util.ArrayList"%><%@
+tag body-content="empty" %><%
+    // Make sure the imports above do work
+    List<String> l = new ArrayList<String>();
+    l.add("OK");
+    %><p><%=l.get(0)%></p>
\ No newline at end of file

Added: tomcat/trunk/test/webapp-3.0/bug49nnn/bug49297Tag.jsp
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0/bug49nnn/bug49297Tag.jsp?rev=1036969&view=auto
==============================================================================
--- tomcat/trunk/test/webapp-3.0/bug49nnn/bug49297Tag.jsp (added)
+++ tomcat/trunk/test/webapp-3.0/bug49nnn/bug49297Tag.jsp Fri Nov 19 18:21:29 2010
@@ -0,0 +1,23 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+--%>
+<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
+<html>
+  <head><title>Bug 49297 duplicate attribute test case</title></head>
+  <body>
+    <tags:bug49297 />
+  </body>
+</html>
\ No newline at end of file

Propchange: tomcat/trunk/test/webapp-3.0/bug49nnn/bug49297Tag.jsp
------------------------------------------------------------------------------
    svn:eol-style = native



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