Update of 
/var/cvs/contributions/CMSContainer_Modules/rssfeed/src/java/com/finalist/cmsc/rssfeed
In directory 
james.mmbase.org:/tmp/cvs-serv893/rssfeed/src/java/com/finalist/cmsc/rssfeed

Modified Files:
      Tag: b1_4
        RssFeedNavigationRenderer.java 
Log Message:
CMSC-1026 - RSSFeed's output does not validate to the RFC822 standard: fixed 
the DateFormatting and content-type.


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Modules/rssfeed/src/java/com/finalist/cmsc/rssfeed
See also: http://www.mmbase.org/jira/browse/CMSC-1026


Index: RssFeedNavigationRenderer.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Modules/rssfeed/src/java/com/finalist/cmsc/rssfeed/RssFeedNavigationRenderer.java,v
retrieving revision 1.5.2.2
retrieving revision 1.5.2.3
diff -u -b -r1.5.2.2 -r1.5.2.3
--- RssFeedNavigationRenderer.java      6 Feb 2008 20:08:39 -0000       1.5.2.2
+++ RssFeedNavigationRenderer.java      25 Jul 2008 11:13:25 -0000      1.5.2.3
@@ -1,11 +1,11 @@
 package com.finalist.cmsc.rssfeed;
 
 import java.io.IOException;
-import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Locale;
 
 import javax.servlet.ServletConfig;
 import javax.servlet.http.HttpServletRequest;
@@ -38,7 +38,11 @@
 
    private Log log = LogFactory.getLog(RssFeedNavigationRenderer.class);
 
-   private final static DateFormat formatRFC822Date = new SimpleDateFormat("EE 
d MMM yyyy HH:mm:ss zzzzz");
+   /**
+    * The date format defined in RFC 822 and used in RSS feeds.
+    * See e.g. http://www.faqs.org/rfcs/rfc822.html
+    */
+   private final static SimpleDateFormat formatRFC822Date = new 
SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.ENGLISH);
 
 
    public void render(NavigationItem item, HttpServletRequest request, 
HttpServletResponse response,
@@ -47,7 +51,7 @@
       if (item instanceof RssFeed) {
          RssFeed rssFeed = (RssFeed) item;
 
-         response.setHeader("Content-Type", "application/xml+rss; 
charset=UTF-8");
+         response.setHeader("Content-Type", "application/rss+xml; 
charset=UTF-8");
 
          Document doc = XmlUtil.createDocument();
          Element rss = XmlUtil.createRoot(doc, "rss");
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to