import org.apache.el.lang.TestELSupport;
import org.apache.jasper.compiler.TestAttributeParser;
import org.apache.jasper.compiler.TestGenerator;
+import org.apache.jasper.compiler.TestJspDocumentParser;
import org.apache.jasper.compiler.TestParser;
import org.apache.jasper.compiler.TestScriptingVariabler;
import org.apache.jasper.compiler.TestValidator;
// o.a.jasper
suite.addTestSuite(TestAttributeParser.class);
+ suite.addTestSuite(TestJspDocumentParser.class);
suite.addTestSuite(TestGenerator.class);
suite.addTestSuite(TestParser.class);
suite.addTestSuite(TestScriptingVariabler.class);
--- /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
+ */\r
+\r
+package org.apache.jasper.compiler;\r
+\r
+import java.io.File;\r
+import java.io.IOException;\r
+\r
+import org.apache.catalina.startup.Tomcat;\r
+import org.apache.catalina.startup.TomcatBaseTest;\r
+\r
+public class TestJspDocumentParser extends TomcatBaseTest {\r
+ \r
+ public void testBug47977() throws Exception {\r
+ Tomcat tomcat = getTomcatInstance();\r
+\r
+ File appDir = \r
+ new File("test/webapp");\r
+ // app dir is relative to server home\r
+ tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());\r
+ \r
+ tomcat.start();\r
+\r
+ Exception e = null;\r
+ try {\r
+ getUrl("http://localhost:" + getPort() + "/test/bug47977.jspx");\r
+ } catch (IOException ioe) {\r
+ e = ioe;\r
+ }\r
+\r
+ // Failure is expected\r
+ assertNotNull(e);\r
+ }\r
+ \r
+ public void testBug48827() throws Exception {\r
+ Tomcat tomcat = getTomcatInstance();\r
+\r
+ File appDir = \r
+ new File("test/webapp");\r
+ // app dir is relative to server home\r
+ tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());\r
+ \r
+ tomcat.start();\r
+\r
+ Exception e = null;\r
+ try {\r
+ getUrl("http://localhost:" + getPort() + "/test/bug48827.jspx");\r
+ } catch (IOException ioe) {\r
+ e = ioe;\r
+ }\r
+\r
+ // Should not fail\r
+ assertNull(e);\r
+ }\r
+}\r
--- /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
+-->\r
+<jsp:root\r
+ xmlns:jsp="http://java.sun.com/JSP/Page" version="2.2"\r
+ xmlns:tags="urn:jsptagdir:/WEB-INF/tags" >\r
+ <jsp:directive.page isELIgnored="false" />\r
+<html>\r
+ <body>\r
+ <tags:echo echo="00-Hello World">xxx</tags:echo>\r
+ </body>\r
+</html>\r
+</jsp:root>
\ No newline at end of file
--- /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
+-->\r
+<jsp:root\r
+ xmlns:jsp="http://java.sun.com/JSP/Page" version="2.2"\r
+ xmlns:tags="urn:jsptagdir:/WEB-INF/tags" >\r
+ <jsp:directive.page isELIgnored="false" />\r
+<html>\r
+ <body>\r
+ <tags:echo>\r
+ <jsp:attribute name="echo">00-Hello World</jsp:attribute>\r
+ </tags:echo>\r
+ <tags:echo echo="01-Hello World"></tags:echo>\r
+ <tags:echo echo="02-Hello World"> </tags:echo>\r
+ </body>\r
+</html>\r
+</jsp:root>
\ No newline at end of file