From: markt Date: Wed, 10 Jun 2009 12:31:29 +0000 (+0000) Subject: Better fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47318 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=15c5f59f9f54731a53282b8be9bf680ab84de074;p=tomcat7.0 Better fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47318 Process include preludes and codas for top level JSP pages only git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@783316 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/jasper/compiler/Parser.java b/java/org/apache/jasper/compiler/Parser.java index 87a29dc39..10945cf22 100644 --- a/java/org/apache/jasper/compiler/Parser.java +++ b/java/org/apache/jasper/compiler/Parser.java @@ -124,20 +124,19 @@ class Parser implements TagConstants { root.setIsDefaultPageEncoding(isDefaultPageEncoding); root.setIsBomPresent(isBomPresent); - if (directivesOnly) { - parser.parseTagFileDirectives(root); - return new Node.Nodes(root); - } - - // For the Top level page, add inlcude-prelude and include-coda + // For the Top level page, add include-prelude and include-coda PageInfo pageInfo = pc.getCompiler().getPageInfo(); - if (parent == null) { + if (parent == null && !isTagFile) { parser.addInclude(root, pageInfo.getIncludePrelude()); } - while (reader.hasMoreInput()) { - parser.parseElements(root); + if (directivesOnly) { + parser.parseFileDirectives(root); + } else { + while (reader.hasMoreInput()) { + parser.parseElements(root); + } } - if (parent == null) { + if (parent == null && !isTagFile) { parser.addInclude(root, pageInfo.getIncludeCoda()); } @@ -1775,7 +1774,7 @@ class Parser implements TagConstants { return JAVAX_BODY_CONTENT_TEMPLATE_TEXT; } - private void parseTagFileDirectives(Node parent) throws JasperException { + private void parseFileDirectives(Node parent) throws JasperException { reader.setSingleFile(true); reader.skipUntil("<"); while (reader.hasMoreInput()) {