My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Usage  
Describes how to use rss4jsf tags
Featured, Phase-Implementation
Updated Feb 4, 2010 by h.iver...@gmail.com

facelets

xmlns:rss4jsf="http://hexiao.cn/rss4jsf"

jsp

<%@ taglib uri="http://www.hexiao.cn/rss4jsf" prefix="rss4jsf" %>

usage

         <rss4jsf:simpleRssOutput
             url="my.rss"
             count="5"
             channelVar="channel"
             itemVar="item"
             >
             <f:facet name="header">
                 <div class="header">
                     <h2>#{channel.name}</h2>
                     <p>#{channel.numberOfItems} items. <a href="#{channel.siteUrl}">View Site</a>.</p>
                 </div>
             </f:facet>
             <f:facet name="item">
                 <div class="item">
                     <h3><a href="#{item.url}">#{item.title}</a></h3>
                     <p>#{item.author} - #{item.body }</p>
                 </div>
             </f:facet>
         </rss4jsf:simpleRssOutput>
Comment by yara.sen...@gmail.com, Aug 14, 2008

Thanks!

The component looks great!

Do you know any component for generating the RSS Feed instead of consuming/reading the RSS Feed ?

Thanks, Yara

Comment by yara.sen...@gmail.com, Aug 14, 2008

I tried it with JSF 1.2 and Netbeans 6 and I got an error for attributes channelVar and itemVar "Unable to find setter method for attribute: channeVar".

But when I follow the sample code at http://bingyu1108.googlepages.com/rss4jsf without setting channelVar and itemVar, it doesn't show anything from the consumed RSS feed.

Any idea of what might be wrong ?

Thanks, Yara

Comment by diogovan...@gmail.com, Nov 9, 2008

Thank you very much, The component is perfect. Just needed something to wear with facelets. =)

Comment by s.ars...@gmail.com, Feb 9, 2009

I just checked out its tld, in tld attribute used channeVar, so we need to use channeVar except channelVar, BUT in Java code, I believe coder using channelVar for setter/getter. Thats why I got error that getter setter not found for channelVar. So.....

Comment by cshi...@gmail.com, Oct 5, 2009

hi.. how do you solve the error? regarding the attribute channelVar..

Comment by djohan...@gmail.com, Jun 3, 2010

Nice component.

I have made a small modification on my local sources. I have add a method in RssItem?.java to format the body. I explain...

Some rss feed comes with HTML tag inside. Sometimes it's not desired. The added method simply remove all HTML tags found. If you need these 3 lines of code :)

Another question, but about Rsslib4JSF. I have a problem if i use your tag on a server who's behind a reverse proxy. I have an RSSException from SimpleRssOutput?.java, line 36, because of a connection refused. It seems to come from the "setXmlResource" method, called from the "parseXmlFile" of the RSSParser class. If you have any idea.

In all case, thanks for your work.

David Johannot

Comment by armen.ar...@gmail.com, Aug 12, 2010

Hello, I have not use rss4jsf, and just do <?xml version='1.0' encoding='UTF-8' ?> <rss xmlns:media="http://search.yahoo.com/mrss/" version="2.0"

xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" >
<f:view contentType="application/rss+xml">
<channel>
<ui:repeat value="#{ArticleRSSListBean.rssList}" var="entry">
<h:outputText value="link"/> <title><h:outputText value="#{entry.subject}"/></title> <link><h:outputText value="#{entry.url}"/> </link> <description><h:outputText value="#{entry.content}"/></description> <pubDate><h:outputText value="#{entry.publishDate}"/></pubDate> <item>
<title><h:outputText value="#{entry.subject}"/></title> <guid><h:outputText value="#{entry.url}"/></guid> <link><h:outputText value="#{entry.url}"/></link> <description><h:outputText value="#{entry.content}"/></description> <pubDate><h:outputText value="#{entry.publishDate}"/></pubDate>
</item>
</ui:repeat>
</channel>

</f:view>

</rss> result you can see in the site lastpubs.com http://lastpubs.com/rss.jsf


Sign in to add a comment
Powered by Google Project Hosting