tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pier...@locus.apache.org
Subject cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler JspParseEventListener.java
Date Thu, 21 Dec 2000 23:16:43 GMT
pierred     00/12/21 15:16:42

  Modified:    jasper/src/share/org/apache/jasper/compiler
                        JspParseEventListener.java
  Log:
  Check for null value before invoking method.
  
  From email sent by Brian Bucknam:
  
  It's a long story, but I'm working on a project where Jasper 3.x is embedded
  inside a servlet, which can then be deployed to the container of our
  customer's choice.  The servlet uses JSP files as templates, which is where
  Jasper comes in.
  
  In this type of environment, sometimes thing can go really wrong, and the
  compiled JSP might, in some cases, fail to get a JspFactory, PageContext, or
  JspWriter.
  
  If any of _jspxFactory, pageContext, or out fail to be created, the catch{}
  and finally{} clauses just throw NPE's.
  
  Submitted by: "Bucknam, Brian" <Brian.Bucknam@webgain.com>
  
  Revision  Changes    Path
  1.19      +6 -6      jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java
  
  Index: JspParseEventListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- JspParseEventListener.java	2000/12/10 05:56:43	1.18
  +++ JspParseEventListener.java	2000/12/21 23:16:41	1.19
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
1.18 2000/12/10 05:56:43 pierred Exp $
  - * $Revision: 1.18 $
  - * $Date: 2000/12/10 05:56:43 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
1.19 2000/12/21 23:16:41 pierred Exp $
  + * $Revision: 1.19 $
  + * $Date: 2000/12/21 23:16:41 $
    *
    * ====================================================================
    *
  @@ -369,16 +369,16 @@
   	writer.popIndent();
   	writer.println("} catch (Throwable t) {");
   	writer.pushIndent();
  -        writer.println("if (out.getBufferSize() != 0)");
  +        writer.println("if (out != null && out.getBufferSize() != 0)");
           writer.pushIndent();
   	writer.println("out.clearBuffer();");
   	writer.popIndent();
  -	writer.println("pageContext.handlePageException(t);");
  +	writer.println("if (pageContext != null) pageContext.handlePageException(t);");
   	writer.popIndent();
   	writer.println("} finally {");
   	writer.pushIndent();
   	/* Do stuff here for finally actions... */
  -	writer.println("_jspxFactory.releasePageContext(pageContext);");
  +	writer.println("if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);");
   	writer.popIndent();
   	writer.println("}");
   	// Close the service method:
  
  
  

Mime
View raw message