tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@locus.apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core StandardWrapperValve.java
Date Fri, 13 Oct 2000 05:25:11 GMT
craigmcc    00/10/12 22:25:08

  Modified:    catalina/src/share/org/apache/catalina Globals.java
               catalina/src/share/org/apache/catalina/core
                        StandardWrapperValve.java
  Removed:     .        RELEASE-NOTES-4.0-M2.txt
  Log:
  Pass two additional request parameters to an error page:
    javax.servlet.error.exception - The actual exception that occurred
    javax.servlet.error.request_uri - The request URI of the page on which
      the error occurred
  
  Revision  Changes    Path
  1.10      +20 -4     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java
  
  Index: Globals.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Globals.java	2000/10/10 04:56:26	1.9
  +++ Globals.java	2000/10/13 05:25:06	1.10
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java,v
1.9 2000/10/10 04:56:26 craigmcc Exp $
  - * $Revision: 1.9 $
  - * $Date: 2000/10/10 04:56:26 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java,v
1.10 2000/10/13 05:25:06 craigmcc Exp $
  + * $Revision: 1.10 $
  + * $Date: 2000/10/13 05:25:06 $
    *
    * ====================================================================
    *
  @@ -69,7 +69,7 @@
    * Global constants that are applicable to multiple packages within Catalina.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.9 $ $Date: 2000/10/10 04:56:26 $
  + * @version $Revision: 1.10 $ $Date: 2000/10/13 05:25:06 $
    */
   
   public final class Globals {
  @@ -99,6 +99,22 @@
        */
       public static final String CLASS_PATH_ATTR =
   	"org.apache.catalina.jsp_classpath";
  +
  +
  +    /**
  +     * The request attribute under which we forward a Java exception
  +     * (as an object of type Throwable) to an error page.
  +     */
  +    public static final String EXCEPTION_ATTR =
  +        "javax.servlet.error.exception";
  +
  +
  +    /**
  +     * The request attribute under which we forward the request URI
  +     * (as an object of type String) of the page on which an error occurred.
  +     */
  +    public static final String EXCEPTION_PAGE_ATTR =
  +        "javax.servlet.error.request_uri";
   
   
       /**
  
  
  
  1.11      +10 -4     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapperValve.java
  
  Index: StandardWrapperValve.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapperValve.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- StandardWrapperValve.java	2000/10/07 05:27:36	1.10
  +++ StandardWrapperValve.java	2000/10/13 05:25:07	1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapperValve.java,v
1.10 2000/10/07 05:27:36 craigmcc Exp $
  - * $Revision: 1.10 $
  - * $Date: 2000/10/07 05:27:36 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapperValve.java,v
1.11 2000/10/13 05:25:07 craigmcc Exp $
  + * $Revision: 1.11 $
  + * $Date: 2000/10/13 05:25:07 $
    *
    * ====================================================================
    *
  @@ -103,7 +103,7 @@
    * <code>StandardWrapper</code> container implementation.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.10 $ $Date: 2000/10/07 05:27:36 $
  + * @version $Revision: 1.11 $ $Date: 2000/10/13 05:25:07 $
    */
   
   final class StandardWrapperValve
  @@ -554,6 +554,12 @@
   	if (errorPage != null) {
               //            if (debug >= 1)
               //                log(" Sending to custom error page " + errorPage);
  +            ServletRequest sreq = request.getRequest();
  +            sreq.setAttribute(Globals.EXCEPTION_ATTR,
  +                              realError.getClass());
  +            if (sreq instanceof HttpServletRequest)
  +                sreq.setAttribute(Globals.EXCEPTION_PAGE_ATTR,
  +                                  ((HttpServletRequest) sreq).getRequestURI());
   	    request.getRequest().setAttribute(Globals.EXCEPTION_TYPE_ATTR,
   					      realError.getClass());
   	    if (custom(request, response, errorPage))
  
  
  

Mime
View raw message