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, 16 Nov 2001 09:46:53 GMT
remm        01/11/16 01:46:53

  Modified:    catalina/src/share/org/apache/catalina/connector/http
                        HttpProcessor.java
               catalina/src/share/org/apache/catalina/servlets
                        DefaultServlet.java
  Log:
  - Use FHDF instead of SimpleDateFormat.format.
  
  Revision  Changes    Path
  1.40      +8 -7      jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java
  
  Index: HttpProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- HttpProcessor.java	2001/11/09 19:38:43	1.39
  +++ HttpProcessor.java	2001/11/16 09:46:53	1.40
  @@ -1,6 +1,6 @@
  -/* * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
1.39 2001/11/09 19:38:43 remm Exp $
  - * $Revision: 1.39 $
  - * $Date: 2001/11/09 19:38:43 $
  +/* * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
1.40 2001/11/16 09:46:53 remm Exp $
  + * $Revision: 1.40 $
  + * $Date: 2001/11/16 09:46:53 $
    *
    * ====================================================================
    *
  @@ -91,8 +91,9 @@
   import org.apache.catalina.LifecycleException;
   import org.apache.catalina.LifecycleListener;
   import org.apache.catalina.Logger;
  -import org.apache.catalina.util.RequestUtil;
  +import org.apache.catalina.util.FastHttpDateFormat;
   import org.apache.catalina.util.LifecycleSupport;
  +import org.apache.catalina.util.RequestUtil;
   import org.apache.catalina.util.StringManager;
   import org.apache.catalina.util.StringParser;
   
  @@ -106,7 +107,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.39 $ $Date: 2001/11/09 19:38:43 $
  + * @version $Revision: 1.40 $ $Date: 2001/11/16 09:46:53 $
    */
   
   final class HttpProcessor
  @@ -1006,8 +1007,8 @@
   
               // Ask our Container to process this request
               try {
  -                ((HttpServletResponse) response).addDateHeader
  -                    ("Date", System.currentTimeMillis());
  +                ((HttpServletResponse) response).setHeader
  +                    ("Date", FastHttpDateFormat.getCurrentDate());
                   if (ok) {
                       connector.getContainer().invoke(request, response);
                   }
  
  
  
  1.43      +10 -22    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.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- DefaultServlet.java	2001/10/15 01:11:59	1.42
  +++ DefaultServlet.java	2001/11/16 09:46:53	1.43
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
1.42 2001/10/15 01:11:59 remm Exp $
  - * $Revision: 1.42 $
  - * $Date: 2001/10/15 01:11:59 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
1.43 2001/11/16 09:46:53 remm Exp $
  + * $Revision: 1.43 $
  + * $Date: 2001/11/16 09:46:53 $
    *
    * ====================================================================
    *
  @@ -111,9 +111,10 @@
   import org.apache.naming.resources.Resource;
   import org.apache.naming.resources.ResourceAttributes;
   import org.apache.catalina.Globals;
  +import org.apache.catalina.util.FastHttpDateFormat;
   import org.apache.catalina.util.MD5Encoder;
  -import org.apache.catalina.util.StringManager;
   import org.apache.catalina.util.RequestUtil;
  +import org.apache.catalina.util.StringManager;
   
   
   /**
  @@ -122,7 +123,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.42 $ $Date: 2001/10/15 01:11:59 $
  + * @version $Revision: 1.43 $ $Date: 2001/11/16 09:46:53 $
    */
   
   public class DefaultServlet
  @@ -1128,7 +1129,7 @@
               if (debug > 0)
                   log("DefaultServlet.serveFile:  lastModified='" +
                       (new Timestamp(resourceInfo.date)).toString() + "'");
  -            response.setDateHeader("Last-Modified", resourceInfo.date);
  +            response.setHeader("Last-Modified", resourceInfo.httpDate);
   
           }
   
  @@ -1568,7 +1569,7 @@
                   sb.append("</tt></td>\r\n");
   
                   sb.append("<td align=\"right\"><tt>");
  -                sb.append(renderLastModified(childResourceInfo.date));
  +                sb.append(childResourceInfo.httpDate);
                   sb.append("</tt></td>\r\n");
   
                   sb.append("</tr>\r\n");
  @@ -1596,19 +1597,6 @@
   
   
       /**
  -     * Render the last modified date and time for the specified timestamp.
  -     *
  -     * @param lastModified Last modified date and time, in milliseconds since
  -     *  the epoch
  -     */
  -    protected String renderLastModified(long lastModified) {
  -
  -        return (formats[0].format(new Date(lastModified)));
  -
  -    }
  -
  -
  -    /**
        * Render the specified file size (in bytes).
        *
        * @param size File size (in bytes)
  @@ -2190,10 +2178,10 @@
                               creationDate = tempDate.getTime();
                           tempDate = tempAttrs.getLastModifiedDate();
                           if (tempDate != null) {
  +                            httpDate = FastHttpDateFormat.getDate(tempDate);
                               date = tempDate.getTime();
  -                            httpDate = formats[0].format(tempDate);
                           } else {
  -                            httpDate = formats[0].format(new Date());
  +                            httpDate = FastHttpDateFormat.getCurrentDate();
                           }
                           length = tempAttrs.getContentLength();
                       }
  
  
  

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