tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves ErrorReportValve.java
Date Thu, 24 Jan 2002 22:52:31 GMT
remm        02/01/24 14:52:31

  Modified:    catalina/src/share/org/apache/catalina/valves Tag:
                        tomcat_40_branch ErrorReportValve.java
  Log:
  - Don't set content-type when the reporter is null.
  - Fixes bug 5740.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.3   +15 -11    jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/ErrorReportValve.java
  
  Index: ErrorReportValve.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/ErrorReportValve.java,v
  retrieving revision 1.5.2.2
  retrieving revision 1.5.2.3
  diff -u -r1.5.2.2 -r1.5.2.3
  --- ErrorReportValve.java	17 Dec 2001 20:41:00 -0000	1.5.2.2
  +++ ErrorReportValve.java	24 Jan 2002 22:52:31 -0000	1.5.2.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/ErrorReportValve.java,v
1.5.2.2 2001/12/17 20:41:00 remm Exp $
  - * $Revision: 1.5.2.2 $
  - * $Date: 2001/12/17 20:41:00 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/ErrorReportValve.java,v
1.5.2.3 2002/01/24 22:52:31 remm Exp $
  + * $Revision: 1.5.2.3 $
  + * $Date: 2002/01/24 22:52:31 $
    *
    * ====================================================================
    *
  @@ -104,7 +104,7 @@
    * @author Craig R. McClanahan
    * @author <a href="mailto:nicolaken@supereva.it">Nicola Ken Barozzi</a> Aisa
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.5.2.2 $ $Date: 2001/12/17 20:41:00 $
  + * @version $Revision: 1.5.2.3 $ $Date: 2002/01/24 22:52:31 $
    */
   
   public class ErrorReportValve
  @@ -289,13 +289,6 @@
           if (report == null)
               return;
   
  -        try {
  -            hres.setContentType("text/html");
  -        } catch (Throwable t) {
  -            if (debug >= 1)
  -                log("status.setContentType", t);
  -        }
  -
           StringBuffer sb = new StringBuffer();
   
           sb.append("<html><head><title>");
  @@ -352,13 +345,24 @@
           sb.append("</body></html>");
   
           try {
  +
               Writer writer = response.getReporter();
               if (writer != null) {
  +
  +                try {
  +                    hres.setContentType("text/html");
  +                } catch (Throwable t) {
  +                    if (debug >= 1)
  +                        log("status.setContentType", t);
  +                }
  +
                   // If writer is null, it's an indication that the response has
                   // been hard committed already
                   writer.write(sb.toString());
                   writer.flush();
  +
               }
  +
           } catch (IOException e) {
               ;
           } catch (IllegalStateException e) {
  
  
  

--
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