tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/valves RequestListenerValve.java
Date Mon, 18 Nov 2002 18:38:12 GMT
bobh        2002/11/18 10:38:12

  Modified:    catalina/src/share/org/apache/catalina/valves
                        RequestListenerValve.java
  Log:
  - Servlet 2.4, section 10.6 talks about how to handle "Listener Exceptions."
    It says a listener exception should cause the error page handling stuff
    to be triggered.  This change does that.
  
  Revision  Changes    Path
  1.2       +13 -4     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/valves/RequestListenerValve.java
  
  Index: RequestListenerValve.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/valves/RequestListenerValve.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RequestListenerValve.java	9 Aug 2002 02:07:12 -0000	1.1
  +++ RequestListenerValve.java	18 Nov 2002 18:38:12 -0000	1.2
  @@ -67,8 +67,10 @@
   
   import java.io.IOException;
   import javax.servlet.ServletException;
  +import javax.servlet.ServletRequest;
   import javax.servlet.ServletRequestEvent;
   import javax.servlet.ServletRequestListener;
  +import org.apache.catalina.Globals;
   import org.apache.catalina.Logger;
   import org.apache.catalina.Request;
   import org.apache.catalina.Response;
  @@ -163,6 +165,10 @@
               } catch (Throwable t) {
                   log(sm.getString("requestListenerValve.requestInit",
                                    instances[i].getClass().getName()), t);
  +
  +                ServletRequest sreq = request.getRequest();
  +                sreq.setAttribute(Globals.EXCEPTION_ATTR,t);
  +                return;
               }
           }
   
  @@ -182,6 +188,9 @@
               } catch (Throwable t) {
                   log(sm.getString("requestListenerValve.requestDestroy",
                                    instances[i].getClass().getName()), t);
  +
  +                ServletRequest sreq = request.getRequest();
  +                sreq.setAttribute(Globals.EXCEPTION_ATTR,t);
               }
           }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message