The JavaServer Faces Rss Bar component generates necessary HTML tags and
stylesheet for rendering the actual content of the RSS feed, which is obtained
through AJAX request in the background.
The tag library for the Rss Bar component can be accessed using the
declaration
<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %>.
<ui:rssBar url="https://blueprints.dev.java.net/servlets/ProjectRSS?type=news"
itemCount="4"
title="News from BlurPrints"
backgroundImage="default"
fontSize="14"
speed="3000"
color="#00ffff"
hoverColor="="#ff00ff">
</ui:rssBar>
Attribute | Description | Required | Default |
---|---|---|---|
url | Specifies the URL of RSS feed | Yes | N/A |
itemCount | Specifies number of item in the RSS appear on the RSS Bar | No | All items |
title | Specifies the title of this RSS Bar | No | Title in the <channel> |
backgroundImage | Specifies if this RSS Bar needs the background image. Accepts only no or default | No | no |
fontSize | Specifies the font size of characters by pixel | No | 14 |
speed | Specifies the speed of switching the items by millisecond | No | 2000 |
color | Specifies the color of characters | No | #000033 |
hoverColor | Specifies the color of characters when the mouse is over | No | #663300 |
Since XmlHttpRequest cannot retrieve the resource from the domain different from the original one, RssBar component has a http client to access the RSS feed. For the case when the proxy is required, the following configuration is necessary in web.xml deployment descriptor.
<context-param>
<param-name>proxyHost</param-name>
<param-value>YOUR_PROXY_SERVER</param-value>
</context-param>
<context-param>
<param-name>proxyPort</param-name>
<param-value>YOUR_PROXY_PORT</param-value>
</context-param>
The RssBar JSF component utilized Dojo and Apache Shale Remoting third party libraries to provide JavaScript AJAX functionality and the mechanism to access the dynamic resource. A com.sun.javaee.blueprints.components.ui.rss.RssFeedHandler instance is placed in the user's session once it is instantiated to cache the data from RSS Feed.