horwat      01/07/10 13:12:13

  Modified:    jasper/src/share/org/apache/jasper/compiler
                        ParserController.java
  Log:
  Fixes include bug. Nested include directive files were not found. In an include 
directive, the file should be found relative to the jsp file doing the including.
  
  Helpful hint:
  
    <%@ include file="XX" %> says "file" and is thus relative to the "JSP file".
    <jsp:include page="XXX" /> says "page" and is thus relative to the "JSP page".
  
  Bugzilla #2543
  
  Revision  Changes    Path
  1.16      +1 -2      
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/ParserController.java
  
  Index: ParserController.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/ParserController.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ParserController.java     2001/06/02 18:44:45     1.15
  +++ ParserController.java     2001/07/10 20:12:07     1.16
  @@ -186,7 +186,6 @@
   
           String absFileName = resolveFileName(inFileName);
        //p("filePath: " + filePath);
  -
        String encoding = topFileEncoding;
           InputStreamReader reader = null;
           try {
  @@ -419,7 +418,7 @@
            isAbsolute ?
            inFileName : (String) baseDirStack.peek() + inFileName;
        String baseDir = 
  -         inFileName.substring(0, inFileName.lastIndexOf("/") + 1);
  +         fileName.substring(0, fileName.lastIndexOf("/") + 1);
        baseDirStack.push(baseDir);
        return fileName;
       }
  
  
  

Reply via email to