Author: markt Date: Wed Jul 10 19:47:43 2013 New Revision: 1501938 URL: http://svn.apache.org/r1501938 Log: (empty)
Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java tomcat/tc7.0.x/trunk/test/webapp-3.0/WEB-INF/tags/bug55198.tagx tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1501929 Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java?rev=1501938&r1=1501937&r2=1501938&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java Wed Jul 10 19:47:43 2013 @@ -5,9 +5,9 @@ * 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. @@ -71,7 +71,7 @@ class JspDocumentParser * Outermost (in the nesting hierarchy) node whose body is declared to be * scriptless. If a node's body is declared to be scriptless, all its * nested nodes must be scriptless, too. - */ + */ private Node scriptlessBodyNode; private Locator locator; @@ -242,7 +242,7 @@ class JspDocumentParser * Receives notification of the start of an element. * * This method assigns the given tag attributes to one of 3 buckets: - * + * * - "xmlns" attributes that represent (standard or custom) tag libraries. * - "xmlns" attributes that do not represent tag libraries. * - all remaining attributes. @@ -272,11 +272,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); @@ -288,7 +285,7 @@ class JspDocumentParser if (attrs != null) { /* * Notice that due to a bug in the underlying SAX parser, the - * attributes must be enumerated in descending order. + * attributes must be enumerated in descending order. */ boolean isTaglib = false; for (int i = attrs.getLength() - 1; i >= 0; i--) { @@ -437,7 +434,7 @@ class JspDocumentParser * invoke this method with chunks of it. This is a problem when we try * to determine if the text contains only whitespaces, or when we are * looking for an EL expression string. Therefore it is necessary to - * buffer and concatenate the chunks and process the concatenated text + * buffer and concatenate the chunks and process the concatenated text * later (at beginTag and endTag) * * @param buf The characters @@ -670,7 +667,7 @@ class JspDocumentParser if (!(child instanceof Node.NamedAttribute)) { throw new SAXParseException(Localizer.getMessage( "jasper.error.emptybodycontent.nonempty", - current.qName), locator); + current.qName), locator); } } } @@ -785,7 +782,7 @@ class JspDocumentParser } /* - * Receives notification of the start of a Namespace mapping. + * Receives notification of the start of a Namespace mapping. */ @Override public void startPrefixMapping(String prefix, String uri) @@ -795,7 +792,7 @@ class JspDocumentParser if (directivesOnly && !(JSP_URI.equals(uri))) { return; } - + try { taglibInfo = getTaglibInfo(prefix, uri); } catch (JasperException je) { @@ -816,7 +813,7 @@ class JspDocumentParser } /* - * Receives notification of the end of a Namespace mapping. + * Receives notification of the end of a Namespace mapping. */ @Override public void endPrefixMapping(String prefix) throws SAXException { @@ -1435,7 +1432,7 @@ class JspDocumentParser //factory.setFeature( // "http://xml.org/sax/features/validation", // validating); - + // Configure the parser SAXParser saxParser = factory.newSAXParser(); XMLReader xmlReader = saxParser.getXMLReader(); Modified: tomcat/tc7.0.x/trunk/test/webapp-3.0/WEB-INF/tags/bug55198.tagx URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/webapp-3.0/WEB-INF/tags/bug55198.tagx?rev=1501938&r1=1501937&r2=1501938&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/test/webapp-3.0/WEB-INF/tags/bug55198.tagx (original) +++ tomcat/tc7.0.x/trunk/test/webapp-3.0/WEB-INF/tags/bug55198.tagx Wed Jul 10 19:47:43 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> Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1501938&r1=1501937&r2=1501938&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Jul 10 19:47:43 2013 @@ -102,6 +102,11 @@ returns true if the base object is an instance of ResourceBundle. (violetagg) </fix> + <fix> + <bug>55207</bug>: Enfore the restriction that a <jsp:text> element + may not contain any sub-elements from any namespace. Patch provided by + Jeremy Boynes. (mark)) + </fix> </changelog> </subsection> <subsection name="Cluster"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org