1 Reply Latest reply on Oct 27, 2006 9:21 AM by lcoetzee

    Creating RSS feed ?

    lcoetzee

      Hi,

      I have been trying to create a rss feed publishing things (new elements) along the line of the example in the jboss-seam blog example. For some very weird reason I am not able to get Seam to inject/unwrap when the rss news feed page is accessed.

      my rss page looks something like this(rssNewsFeed.rss):

      <rss version="0.91"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html">
       <channel>
      
       <title>This is a RSS feed </title>
       <link>http://localhost:8080/portal/public/content/view/viewServicesHome.jsf</link>
       <description>This is a description of the rss feed</description>
       <language>en</language>
      
      
      
       <ui:repeat value="#{rssFeed.entries}" var="content">
       <item>
       <title>#{content.contentName.name}</title>
       <link>http://localhost:8080/portal/public/content/view/viewContent.jsf?selectedContentId=#{content.id}</link>
       <description>
       <h:outputText value="#{content.contentDescription.description}"/>
       </description>
       </item>
       </ui:repeat>
      
      
       </channel>
      </rss>
      


      with my manager component:
      @Name("rssFeed")
      @Scope(ScopeType.STATELESS)
      public class RSSFeed {
      
       @In(create=true)
       RSS rssBean;
      
      
       private List<Content> entries;
      
      
       @Unwrap
       public RSSFeed listAllNewContent() throws NAPPublicException{
       entries = rssBean.listAllNewContent();
       return this;
       }
      
      
       public List<Content> getEntries() {
       return entries;
       }
      
      
       public void setEntries(List<Content> entries) {
       this.entries = entries;
       }
      
      }
      
      


      I am able to subscribe to the rss feed using a normal aggregator, but for some reason when the page is accessed Seam does not intercept and outject/unwrap the RSSFeed component.

      Is there something else I must set to get the rss page populated (with the dynamic stuff) when it is accessed ? It is almost as if Seam/tomcat/jboss does not know it has to intercept and do its things when the page is retrieved.

      I am sure it is something stupid (it is very similar to the blog example). Any suggestions would be appreciated.

      Thanks

      Louis


        • 1. Re: Creating RSS feed ?
          lcoetzee

          Strange how writing things down helps the mind :-)

          I see in the blog example that the faces servlet is mapped to:

          <servlet-mapping>
           <servlet-name>Faces Servlet</servlet-name>
           <url-pattern>/seam/*</url-pattern>
           </servlet-mapping>
          


          while I use:
          <servlet-mapping>
           <servlet-name>Faces Servlet</servlet-name>
           <url-pattern>*.jsf</url-pattern>
           </servlet-mapping>


          and the important one

          <context-param>
           <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
           <param-value>.xhtml</param-value>
           </context-param>



          My rss file had an rss extension, with the above in mind the rss extension never got the Faces servlet involved. Renaming my file to have an xhtml extension solved the problem.


          L