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/servlets DefaultServlet.java
Date Fri, 05 Oct 2001 17:09:28 GMT
remm        01/10/05 10:09:28

  Modified:    catalina/src/share/org/apache/catalina/servlets Tag:
                        tomcat_40_branch DefaultServlet.java
  Log:
  - Don't set last-modified when displaying a directory browsing page.
  - Don't check if headers when resource is a collection.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.39.2.2  +21 -18    jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java
  
  Index: DefaultServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
  retrieving revision 1.39.2.1
  retrieving revision 1.39.2.2
  diff -u -r1.39.2.1 -r1.39.2.2
  --- DefaultServlet.java	2001/10/04 19:28:56	1.39.2.1
  +++ DefaultServlet.java	2001/10/05 17:09:28	1.39.2.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
1.39.2.1 2001/10/04 19:28:56 remm Exp $
  - * $Revision: 1.39.2.1 $
  - * $Date: 2001/10/04 19:28:56 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
1.39.2.2 2001/10/05 17:09:28 remm Exp $
  + * $Revision: 1.39.2.2 $
  + * $Date: 2001/10/05 17:09:28 $
    *
    * ====================================================================
    *
  @@ -122,7 +122,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.39.2.1 $ $Date: 2001/10/04 19:28:56 $
  + * @version $Revision: 1.39.2.2 $ $Date: 2001/10/05 17:09:28 $
    */
   
   public class DefaultServlet
  @@ -1089,18 +1089,23 @@
                   return;
               }
   
  -        }
  +        } else {
   
  -        // Checking If headers
  -        if ( !checkIfHeaders(request, response, resourceInfo) ) {
  -            return;
  +            // Checking If headers
  +            if ( !checkIfHeaders(request, response, resourceInfo) ) {
  +                return;
  +            }
  +
           }
   
           // Find content type.
           String contentType =
               getServletContext().getMimeType(resourceInfo.path);
   
  +        Vector ranges = null;
  +
           if (resourceInfo.collection) {
  +
               // Skip directory listings if we have been configured to
               // suppress them
               if (!listings) {
  @@ -1109,25 +1114,23 @@
                   return;
               }
               contentType = "text/html;charset=UTF-8";
  -        }
   
  +        } else {
   
  -        // Parse range specifier
  -        Vector ranges = null;
  -        if (!resourceInfo.collection) {
  +            // Parse range specifier
   
               ranges = parseRange(request, response, resourceInfo);
   
               // ETag header
               response.setHeader("ETag", getETag(resourceInfo, true));
   
  -        }
  +            // Last-Modified header
  +            if (debug > 0)
  +                log("DefaultServlet.serveFile:  lastModified='" +
  +                    (new Timestamp(resourceInfo.date)).toString() + "'");
  +            response.setDateHeader("Last-Modified", resourceInfo.date);
   
  -        // Last-Modified header
  -        if (debug > 0)
  -            log("DefaultServlet.serveFile:  lastModified='" +
  -                (new Timestamp(resourceInfo.date)).toString() + "'");
  -        response.setDateHeader("Last-Modified", resourceInfo.date);
  +        }
   
           ServletOutputStream ostream = null;
           PrintWriter writer = null;
  
  
  

Mime
View raw message