在HttpServlet类的服务方法中的最后修改比较

时间:2017-07-13 10:44:48

标签: servlets

我经历了HttpServlet类服务方法,我很困惑这个语句在该方法中正在做什么。

if (ifModifiedSince < (lastModified / 1000 * 1000)) {
     // If the servlet mod time is later, call doGet()
     // Round down to the nearest second for a proper compare
     // A ifModifiedSince of -1 will always be less
     maybeSetLastModified(resp, lastModified);
     doGet(req, resp);
  } else {
          resp.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
         }

我们如何计算lastmodified以将其与ifModifiedSince进行比较?

0 个答案:

没有答案