tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r783316 - /tomcat/trunk/java/org/apache/jasper/compiler/Parser.java
Date Wed, 10 Jun 2009 12:31:30 GMT
Author: markt
Date: Wed Jun 10 12:31:29 2009
New Revision: 783316

URL: http://svn.apache.org/viewvc?rev=783316&view=rev
Log:
Better fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47318
Process include preludes and codas for top level JSP pages only

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/Parser.java

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Parser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Parser.java?rev=783316&r1=783315&r2=783316&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Parser.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Parser.java Wed Jun 10 12:31:29 2009
@@ -124,20 +124,19 @@
         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 @@
         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()) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message