* Attribute)*
*/
private void parseTagDirective(Node parent) throws JasperException {
- Attributes attrs = parseAttributes();
+ Attributes attrs = parseAttributes(true);
Node.TagDirective n = new Node.TagDirective(attrs, start, parent);
/*
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);
--- /dev/null
+<%--\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to You under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+--%><%@ tag import="java.util.List" import="java.util.ArrayList"%><%@\r
+tag body-content="empty" %><%\r
+ // Make sure the imports above do work\r
+ List<String> l = new ArrayList<String>();\r
+ l.add("OK");\r
+ %><p><%=l.get(0)%></p>
\ No newline at end of file
--- /dev/null
+<%--
+ 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