• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to save data returned from a Tag Library

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using a Tag Library to get RSS feeds which is working just fine.
My question is how can save put the returned information into a variable to save into a database? I assume it returns a collection and loops through the contents.

Here is my code I'm currently using:
---------
<%@ page contentType = "text/html; charset=iso-8859-1" %>
<%@ page language = "java" %>
<%@ page import = "java.sql.*,java.util.*" %>
<%@ taglib uri = "/WEB-INF/tlds/rssutils.tld" prefix="RSS" %>
<RSS:feed url="http://rss.news.yahoo.com/rss/topstories"
feedId="worldNews"/>
<ul>
<RSS:forEachItem feedId="worldNews" startIndex="1" endIndex="8">
<li><RSS:itemTitle feedId="worldNews"/></li><br>
</RSS:forEachItem>
</ul>
---------

It appears to return a collection called worldNews. How can I access that collection without using the tag syntax like '<RSS:forEachItem'? Is this possible?

Thanks,
Dave
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without knowing any details of the tag implementations it's impossible to say for sure. Do you have the source code for the tag handlers?

Usually tag sets like this are geared towards display of data, but not processing of data (since that's the sort of thing you shouldn't be doing in a JSP in the first place).

If the package is well-written and the authors intended such, there may be a Java API (that the tag handlers themselves use) exported for use in Servlets to perform just such tasks as you are asking about.
[ September 02, 2004: Message edited by: Bear Bibeault ]
 
Heroic work plunger man. Please allow me to introduce you to this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic