roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r469202 - in /incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets: FeedServlet.java PageServlet.java RSDServlet.java
Date Mon, 30 Oct 2006 17:33:04 GMT
Author: snoopdave
Date: Mon Oct 30 09:33:01 2006
New Revision: 469202

URL: http://svn.apache.org/viewvc?view=rev&rev=469202
Log:
Fixing NPE when lastmodified is not yet set

Modified:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/FeedServlet.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/RSDServlet.java

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/FeedServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/FeedServlet.java?view=diff&rev=469202&r1=469201&r2=469202
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/FeedServlet.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/FeedServlet.java
Mon Oct 30 09:33:01 2006
@@ -109,10 +109,10 @@
 
 
         // determine the lastModified date for this content
-        long lastModified = 0;
+        long lastModified = System.currentTimeMillis();
         if(isSiteWide) {
             lastModified = siteWideCache.getLastModified().getTime();
-        } else {
+        } else if (weblog.getLastModified() != null) {
             lastModified = weblog.getLastModified().getTime();
         }
 
@@ -122,7 +122,7 @@
         }
 
         // set last-modified date
-        ModDateHeaderUtil.setLastModifiedHeader(response,lastModified);
+        ModDateHeaderUtil.setLastModifiedHeader(response, lastModified);
 
         // set content type
         String accepts = request.getHeader("Accept");

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java?view=diff&rev=469202&r1=469201&r2=469202
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java
Mon Oct 30 09:33:01 2006
@@ -161,10 +161,10 @@
         
         
         // determine the lastModified date for this content
-        long lastModified = 0;
+        long lastModified = System.currentTimeMillis();
         if(isSiteWide) {
             lastModified = siteWideCache.getLastModified().getTime();
-        } else {
+        } else if (weblog.getLastModified() != null) {
             lastModified = weblog.getLastModified().getTime();
         }
 

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/RSDServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/RSDServlet.java?view=diff&rev=469202&r1=469201&r2=469202
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/RSDServlet.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/RSDServlet.java
Mon Oct 30 09:33:01 2006
@@ -95,7 +95,10 @@
         
 
         // Respond with 304 Not Modified if it is not modified.
-        long lastModified = weblog.getLastModified().getTime();
+        long lastModified = System.currentTimeMillis();
+        if (weblog.getLastModified() != null) {
+            lastModified = weblog.getLastModified().getTime();
+        }
         if (ModDateHeaderUtil.respondIfNotModified(request,response,lastModified)) {
             return;
         }



Mime
View raw message