remm        2003/01/30 09:20:15

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardContext.java
  Log:
  - Add special processing for the 200 error code for status pages (as the check
    occurs all the time). BTW, is it legal to define that ?
  
  Revision  Changes    Path
  1.17      +21 -5     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- StandardContext.java      29 Jan 2003 12:49:58 -0000      1.16
  +++ StandardContext.java      30 Jan 2003 17:20:14 -0000      1.17
  @@ -350,6 +350,12 @@
       private HashMap mimeMappings = new HashMap();
   
   
  +     /**
  +      * Special case: error page for status 200.
  +      */
  +     private ErrorPage okErrorPage = null;
  +
  +
       /**
        * The context initialization parameters for this web application,
        * keyed by name.
  @@ -1505,6 +1511,9 @@
               }
           } else {
               synchronized (statusPages) {
  +                if (errorPage.getErrorCode() == 200) {
  +                    this.okErrorPage = errorPage;
  +                }
                   statusPages.put(new Integer(errorPage.getErrorCode()),
                                   errorPage);
               }
  @@ -2051,7 +2060,11 @@
        */
       public ErrorPage findErrorPage(int errorCode) {
   
  -        return ((ErrorPage) statusPages.get(new Integer(errorCode)));
  +        if (errorCode == 200) {
  +            return (okErrorPage);
  +        } else {
  +            return ((ErrorPage) statusPages.get(new Integer(errorCode)));
  +        }
   
       }
   
  @@ -2948,6 +2961,9 @@
               }
           } else {
               synchronized (statusPages) {
  +                if (errorPage.getErrorCode() == 200) {
  +                    this.okErrorPage = null;
  +                }
                   statusPages.remove(new Integer(errorPage.getErrorCode()));
               }
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to