Grab Headlines From A Remote RSS File
By Nicholas Chase2003-12-19
The Basic JSP Page
Any number of ways of transforming XML data exist. In this article, I'll show you how to create a JSP page that passes a feed to a Java bean for transformation. That bean creates a static file, and the JSP page incorporates it into the body of the page. (The reason for the static file will become clearer in the caching section below.)
The page itself is fairly straightforward:
Listing 4. The JSP page
|
Here you're simply creating an instance of the RSSProcessor class. Because you've included it in the useBean element, the setRSSFile() method executes when the object is created. This method creates the headlines.html page that the JSP page then incorporates into the output.
Next, create the bean to do the transformation.
Tutorial Pages:
» Retrieve Syndicated Content, Transform It, & Display The Result
» The Source File
» The Primary Stylesheet
» The Basic JSP Page
» Transforming The File
» Adjusting For Multiple Formats
» Choosing A Version
» Caching The Feed
» Conclusion
» Resources
First published by IBM developerWorks
