Author: markt Date: Wed Jul 10 19:29:26 2013 New Revision: 1501929 URL: http://svn.apache.org/r1501929 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55207 Enforce requirement that <jsp:text> elements do not contain any other elements. Fix a test that this change found. Patch by Jeremy Boynes.
Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java tomcat/trunk/test/webapp/WEB-INF/tags/bug55198.tagx Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java?rev=1501929&r1=1501928&r2=1501929&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java Wed Jul 10 19:29:26 2013 @@ -270,11 +270,8 @@ class JspDocumentParser return; } - String currentPrefix = getPrefix(current.getQName()); - // jsp:text must not have any subelements - if (JSP_URI.equals(uri) && TEXT_ACTION.equals(current.getLocalName()) - && "jsp".equals(currentPrefix)) { + if (current instanceof Node.JspText) { throw new SAXParseException( Localizer.getMessage("jsp.error.text.has_subelement"), locator); Modified: tomcat/trunk/test/webapp/WEB-INF/tags/bug55198.tagx URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/WEB-INF/tags/bug55198.tagx?rev=1501929&r1=1501928&r2=1501929&view=diff ============================================================================== --- tomcat/trunk/test/webapp/WEB-INF/tags/bug55198.tagx (original) +++ tomcat/trunk/test/webapp/WEB-INF/tags/bug55198.tagx Wed Jul 10 19:29:26 2013 @@ -17,9 +17,7 @@ --> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> <jsp:directive.tag body-content="scriptless" /> -<jsp:text> - <a href="#" onclick="window.alert("${'foo'}")">foo</a> - <a href="#" onclick="window.alert("bar")">bar</a> -</jsp:text> +<a href="#" onclick="window.alert("${'foo'}")">foo</a> +<a href="#" onclick="window.alert("bar")">bar</a> <jsp:doBody /> </jsp:root> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org