remm        01/03/20 16:08:53

  Modified:    jasper/src/share/org/apache/jasper/compiler JspCompiler.java
                        JspReader.java ParserController.java
                        TagLibraryInfoImpl.java
  Log:
  - Jasper should run from WARs (or any other repository which provides a directory
    context to access it).
  - All Watchdog 4 tests pass (servlets, JSP, JSP-XML).
  - Of course, the classes and JARs are still extracted from the WAR until the
    compilation technology is updated (javac wants files :(( ).
  
  Revision  Changes    Path
  1.4       +7 -5      
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspCompiler.java
  
  Index: JspCompiler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspCompiler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JspCompiler.java  2001/02/04 01:05:02     1.3
  +++ JspCompiler.java  2001/03/21 00:08:50     1.4
  @@ -163,17 +163,19 @@
        * from whence it came
        */
       public boolean isOutDated() {
  -        File jspReal = null;
  +        long jspRealLastModified = 0;
   
  -        jspReal = new File(ctxt.getRealPath(jsp.getPath()));
  -
  -        if (!jspReal.exists()) {
  +        try {
  +            jspRealLastModified = ctxt.getResource(jsp.getPath())
  +                .openConnection().getLastModified();
  +        } catch (Exception e) {
  +            e.printStackTrace();
               return true;
           }
   
           File classFile = new File(getClassFileName());
           if (classFile.exists()) {
  -            outDated = classFile.lastModified() < jspReal.lastModified();
  +            outDated = classFile.lastModified() < jspRealLastModified;
           } else {
               outDated = true;
           }
  
  
  
  1.5       +2 -0      
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspReader.java
  
  Index: JspReader.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspReader.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JspReader.java    2000/10/11 19:35:14     1.4
  +++ JspReader.java    2001/03/21 00:08:51     1.5
  @@ -248,6 +248,8 @@
        String longName = (context == null)
            ? file.getAbsolutePath()
            : context.getRealPath(file.toString());
  +        if (longName == null)
  +            longName = file.toString();
   
        int fileid = registerSourceFile(longName);
   
  
  
  
  1.12      +1 -1      
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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ParserController.java     2001/03/15 22:42:12     1.11
  +++ ParserController.java     2001/03/21 00:08:51     1.12
  @@ -187,7 +187,7 @@
           File file = new File(absFileName);
        String filePath = (ctxt == null) 
            ? file.getAbsolutePath()
  -         : ctxt.getRealPath(file.toString());
  +         : file.toString();//ctxt.getRealPath(file.toString());
        //p("filePath: " + filePath);
   
        String encoding = topFileEncoding;
  
  
  
  1.21      +8 -4      
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java
  
  Index: TagLibraryInfoImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- TagLibraryInfoImpl.java   2001/02/18 02:18:14     1.20
  +++ TagLibraryInfoImpl.java   2001/03/21 00:08:52     1.21
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
 1.20 2001/02/18 02:18:14 craigmcc Exp $
  - * $Revision: 1.20 $
  - * $Date: 2001/02/18 02:18:14 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
 1.21 2001/03/21 00:08:52 remm Exp $
  + * $Revision: 1.21 $
  + * $Date: 2001/03/21 00:08:52 $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -152,7 +152,11 @@
           try {
               // see if file exists on the filesystem first
               String real = ctxt.getRealPath(uri);
  -            return (real == null) ? null : new FileInputStream(real);
  +            if (real == null) {
  +                return ctxt.getResourceAsStream(uri);
  +            } else {
  +                return new FileInputStream(real);
  +            }
           }
           catch (FileNotFoundException ex) {
               // if file not found on filesystem, get the resource through
  
  
  

Reply via email to