You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by sh...@locus.apache.org on 2000/05/25 17:57:46 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/jasper JspC.java

shemnon     00/05/25 08:57:44

  Modified:    src/share/org/apache/jasper JspC.java
  Log:
  Fixed a nullpointer exception thrown when a jsp pages is compiled
  outside of a webapp tree.
  bug reported by Kevin Jones
  
  Revision  Changes    Path
  1.11      +17 -4     jakarta-tomcat/src/share/org/apache/jasper/JspC.java
  
  Index: JspC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JspC.java	2000/03/30 04:28:06	1.10
  +++ JspC.java	2000/05/25 15:57:42	1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v 1.10 2000/03/30 04:28:06 shemnon Exp $
  - * $Revision: 1.10 $
  - * $Date: 2000/03/30 04:28:06 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v 1.11 2000/05/25 15:57:42 shemnon Exp $
  + * $Revision: 1.11 $
  + * $Date: 2000/05/25 15:57:42 $
    *
    * ====================================================================
    * 
  @@ -435,7 +435,20 @@
                           if (f.exists() && f.isDirectory()) {
                               tUriBase = "/" + f.getName() + "/" + tUriBase;
                           };
  -                        f = new File(f.getParent());
  +                        
  +                        String fParent = f.getParent();
  +                        if (fParent == null) {
  +                            f = new File(args[argPos]);
  +                            fParent = f.getParent();
  +                            if (fParent == null) {
  +                                fParent = File.separator;
  +                            }
  +                            uriRoot = new File(fParent).getCanonicalPath();
  +                            uriBase = "/";
  +                            break;
  +                        } else {
  +                            f = new File(fParent);
  +                        }
   
                           // If there is no acceptible candidate, uriRoot will
                           // remain null to indicate to the CompilerContext to