You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Carroll Guertin Jr." <ca...@openave.com> on 2000/07/08 01:25:04 UTC

jsp:param RE: [PATCH] Fix for nested <%@ include ... %> bug

jsp:param appears to be broken too

<jsp:param name="parameterName" value="{parameterValue | <%= expression
%> }" />


-----Original Message-----
From: Larry Isaacs [mailto:Larry.Isaacs@sas.com]
Sent: Friday, July 07, 2000 2:51 PM
To: 'tomcat-dev@jakarta.apache.org'
Subject: [PATCH] Fix for nested <%@ include ... %> bug


I would like to ask again that the nested <%@ include ...%> bug be fixed.
Since not a lot has changed with JspReader.java, the following patch still
works and introduces no failures in Watchdog.  Please consider for inclusion
in Tomcat 3.2.

An earlier e-mail about this included a set of test files to demonstrate
that it works.  I can provide them again if desired, though the ".." patch
sent earlier will be needed for the test to pass.

Thanks,
Larry

========== JspReader.java patchfile ==========
--- JspReader.java.orig	Fri Jul 07 03:20:58 2000
+++ JspReader.java	Fri Jul 07 17:26:18 2000
@@ -138,13 +138,13 @@
             null : master.substring(0, master.lastIndexOf("/") + 1);
         boolean isAbsolute = name.startsWith("/");

-        if (parent == null || isAbsolute)
-            pushFile(new File(name), encoding);
-        else
-            pushFile(new File(parent + name), encoding);
-
-        if (master == null)
+        if (parent == null || isAbsolute) {
             master = name;
+            pushFile(new File(name), encoding);
+        } else {
+            master = parent + name;
+            pushFile(new File(master), encoding);
+        }
     }

     /**
@@ -202,10 +202,10 @@
 	    caw.close();
 	    if (current == null) {
 		current = new Mark( this, caw.toCharArray(), fileid, getFile(fileid),
-				    file.getParent(), encoding );
+				    master, encoding );
 	    } else {
 		current.pushStream( caw.toCharArray(), fileid, getFile(fileid),
-				    file.getParent(), encoding );
+				    master, encoding );
 	    }

         } catch (FileNotFoundException fnfe) {
@@ -239,7 +239,10 @@
 		(Constants.getString("jsp.error.file.not.registered",
 				     new Object[] {fName}));

-	return current.popStream();
+	boolean r = current.popStream();
+	if (r)
+		master = current.baseDir;
+	return r;
     }

     protected JspReader(String file, JspCompilationContext ctx, String
encoding)
==============================================

__________
Larry Isaacs
Larry.Isaacs@sas.com
SAS Institute Inc.

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