As a follow up to the earlier post on using freemarker, here is an example of creating RSS 2.0 feeds using a freemarker template. This FTL will work assuming there is an input javabean that has a collection accessible via getItems() and returns a list of Item objects. Each Item would have a title, description, link, and last modified date properties as shown below:
<rss version="2.0">
<channel>
<#list items as myitem>
<item>
<title>${myitem.title?html}</title>
<description>${myitem.description?html}</description>
<link>${myitem.link}</link>
<pubDate>${myitem.lastmodifiedDate?datetime}</pubDate>
</item>
</#list>
</channel>
</rss>
Advertisement








