diff options
-rw-r--r-- | org/madore/damlengine/WeblogServlet.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/org/madore/damlengine/WeblogServlet.java b/org/madore/damlengine/WeblogServlet.java index 568a9ec..d3b2523 100644 --- a/org/madore/damlengine/WeblogServlet.java +++ b/org/madore/damlengine/WeblogServlet.java @@ -34,7 +34,7 @@ import javax.servlet.http.HttpServletResponse; public class WeblogServlet extends HttpServlet { - private static final long serialVersionUID = 2014100703L; + private static final long serialVersionUID = 2014100704L; @Override public void init(ServletConfig cfg) @@ -83,8 +83,18 @@ public class WeblogServlet extends HttpServlet { double mdate = selRes.getDouble(2); if ( id != number ) throw new ServletException("this cannot happen"); - long lastModified = ((long)mdate)*1000; - // O'Reilly recommends not using milliseconds part. + long lastModified = (long)(mdate*1000); + long thisLastModified; + try { + // Attempts to detect when *this* class was last modified. + thisLastModified = WeblogServlet.class.getResource("WeblogServlet.class").openConnection().getLastModified(); + } catch (Exception e) { + thisLastModified = 0; + } + if ( thisLastModified > lastModified ) + lastModified = thisLastModified; + // O'Reilly recommends not using milliseconds part: + lastModified = (lastModified/1000)*1000; return new SingleBlogEntryPath(number, lastModified); } else return new NoSuchPath(); |