remm        01/03/21 19:40:02

  Modified:    jasper/src/share/org/apache/jasper/compiler JspCompiler.java
  Log:
  - Avoid generating NPEs when resource doesn't exist.
  
  Revision  Changes    Path
  1.5       +5 -2      
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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JspCompiler.java  2001/03/21 00:08:50     1.4
  +++ JspCompiler.java  2001/03/22 03:40:02     1.5
  @@ -57,6 +57,7 @@
   
   import java.io.File;
   import java.io.FileNotFoundException;
  +import java.net.URL;
   
   import org.apache.jasper.JspCompilationContext;
   import org.apache.jasper.Constants;
  @@ -166,8 +167,10 @@
           long jspRealLastModified = 0;
   
           try {
  -            jspRealLastModified = ctxt.getResource(jsp.getPath())
  -                .openConnection().getLastModified();
  +            URL jspUrl = ctxt.getResource(jsp.getPath());
  +            if (jspUrl == null)
  +                return true;
  +            jspRealLastModified = jspUrl.openConnection().getLastModified();
           } catch (Exception e) {
               e.printStackTrace();
               return true;
  
  
  

Reply via email to