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/runtime PageContextImpl.java
Date Sun, 26 Nov 2000 16:13:58 GMT
pierred     00/11/26 08:13:57

  Modified:    jasper/src/share/org/apache/jasper/runtime
                        PageContextImpl.java
  Log:
  PageContext has two variations of handlePageException().
  Have the one with the Exception argument simply calls the
  one with the Throwable argument to avoid duplication of
  code (I had previously modified the first one without
  updating the second one). Sent message to spec lead inquiring
  why both variations are kept in 1.2. Backward compatibility
  is not a valid reason imho.
  
  Revision  Changes    Path
  1.7       +20 -36    jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PageContextImpl.java	2000/11/21 00:02:23	1.6
  +++ PageContextImpl.java	2000/11/26 16:13:57	1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
1.6 2000/11/21 00:02:23 pierred Exp $
  - * $Revision: 1.6 $
  - * $Date: 2000/11/21 00:02:23 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
1.7 2000/11/26 16:13:57 pierred Exp $
  + * $Revision: 1.7 $
  + * $Date: 2000/11/26 16:13:57 $
    *
    * ====================================================================
    *
  @@ -452,11 +452,19 @@
           return out;
       }
   
  -    public void handlePageException(Exception e)
  -    throws IOException, ServletException {
  +    public void handlePageException(Exception ex)
  +        throws IOException, ServletException 
  +    {
  +	// Should never be called since handleException() called with a
  +	// Throwable in the generated servlet.
  +	handlePageException((Throwable) ex);
  +    }
   
  -	// set the request attribute with the exception.
  -	request.setAttribute("javax.servlet.jsp.jspException", e);
  +    public void handlePageException(Throwable t)
  +        throws IOException, ServletException 
  +    {
  +        // set the request attribute with the Throwable.
  +	request.setAttribute("javax.servlet.jsp.jspException", t);
   
   	if (errorPageURL != null && !errorPageURL.equals("")) {
               try {
  @@ -464,38 +472,14 @@
               } catch (IllegalStateException ise) {
                   include(errorPageURL);
               }
  -	} // Otherwise throw the exception wrapped inside a ServletException.
  -	else {
  +	} else {
  +            // Otherwise throw the exception wrapped inside a ServletException.
   	    // Set the exception as the root cause in the ServletException
   	    // to get a stack trace for the real problem
  -	    if( e instanceof IOException )
  -		throw (IOException)e;
  -	    if( e instanceof ServletException )
  -		throw (ServletException) e;
  -	    throw new ServletException(e);
  +	    if (t instanceof IOException) throw (IOException)t;
  +	    if (t instanceof ServletException) throw (ServletException)t;
  +	    throw new ServletException(t);
   	}
  -
  -    }
  -
  -    public void handlePageException(Throwable e)
  -    throws IOException, ServletException {
  -
  -	// set the request attribute with the exception.
  -	request.setAttribute("javax.servlet.jsp.jspException", e);
  -
  -	if (errorPageURL != null && !errorPageURL.equals("")) {
  -	    forward(errorPageURL);
  -	} // Otherwise throw the exception wrapped inside a ServletException.
  -	else {
  -	    // Set the exception as the root cause in the ServletException
  -	    // to get a stack trace for the real problem
  -	    if( e instanceof IOException )
  -		throw (IOException)e;
  -	    if( e instanceof ServletException )
  -		throw (ServletException) e;
  -	    throw new ServletException(e);
  -	}
  -
       }
   
       protected JspWriter _createOut(int bufferSize, boolean autoFlush)
  
  
  

Mime
View raw message