A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Java
»
JSP
Author
RSS / JSTL Problem
Unnsse Khan
Ranch Hand
Joined: Nov 12, 2001
Posts: 511
posted
Sep 15, 2006 03:13:00
0
Hello again,
This is my getNews.jsp file:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %> <html><body> <p> <c:import var="news" url="http://developers.sun.com/rss/java.xml" /> <x:parse var="doc" xml="${news}" /> <strong> <x:out select="$doc/rss/channel/title" /> </strong> </p> <p> <x:out select="$doc/rss/channel/description" /> <x:forEach var="$doc/rss/channel/item/title" select="$doc/rss/channel/item"> <a href="<x:out select="link"/>"> <x:out select="$doc/rss/channel/item/title/link"/> </a> </x:forEach> </p> </body> </html>
I get the following output in my browser:
Java Technology Headlines
Technical content and news from java.sun.com, the premier source of information about the Java platform.
But, I don't get a list of Hyperlinks that have Sun's individual story names for the descriptive text inside the anchor tag (<a href>).
What am I possibly doing wrong?
Many, many thanks!
Rusty Smythe
Ranch Hand
Joined: Aug 09, 2006
Posts: 93
posted
Sep 15, 2006 09:25:00
0
Change this
<a href="<x:out select="link"/>"> <x:out select="$doc/rss/channel/item/title/link"/> </a>
to this
<x:out select="$doc/rss/channel/item/title/link"/>
Did you get any output? I'm guessing you did not -- and that would mean that your reference to the tag is wrong. Maybe you just need
<x:out select="link"/>
Please post the source of the
OUTPUT
, and we'll see what's what...
Unnsse Khan
Ranch Hand
Joined: Nov 12, 2001
Posts: 511
posted
Sep 15, 2006 17:36:00
0
Rusty,
Thank you for your response!
You were correct about your 1st suggestion, that I didn't receive any output.
But your second suggestion yielded, the following output:
Java Technology Headlines
Technical content and news from java.sun.com, the premier source of information about the Java platform.
http://java.sun.com/developer/technicalArticles/J2EE/jsf_renderers/?feed=JSC
http://developers.sun.com/prodtech/portalserver/reference/techart/mashups.html?feed=DSC
http://java.sun.com/mailers/techtips/corejava/2006/tt0822.html?feed=JSC
http://java.sun.com/developer/Meet-Eng/ball/?feed=JSC
http://java.sun.com/developer/technicalArticles/javaopensource/OS_qa/?feed=JSC
http://java.sun.com/developer/technicalArticles/WebServices/restful/?feed=JSC
http://java.sun.com/blueprints/ajax.html?feed=JSC
http://weblogs.java.net/blog/gmurray71/archive/2006/08/restricting_acc.html?feed=RSS
http://java.sun.com/developer/technicalArticles/WebServices/high_performance/?feed=JSC
http://java.sun.com/developer/Meet-Eng/marinacci/?feed=JSC
http://developers.sun.com/prodtech/appserver/reference/techart/app_svr_9.html?feed=DSC
http://java.sun.com/developer/technicalArticles/J2SE/Desktop/scripting/?feed=JSC
http://java.sun.com/developer/technicalArticles/J2EE/jsf_resources/?feed=JSC
http://java.sun.com/mailers/techtips/enterprise/2006/TechTips_June06.html?feed=JSC
http://java.sun.com/developer/technicalArticles/xml/dig_signatures/?feed=JSC
http://java.sun.com/developer/technicalArticles/Interviews/goldman_qa2.html?feed=JSC
http://java.sun.com/javascript/ajaxinaction/PascarelloQA.html?feed=JSC
http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/?feed=JSC
http://java.sun.com/developer/technicalArticles/J2EE/poundsyntax/?feed=JSC
http://java.sun.com/javase/6/download.jsp?feed=JSC
http://java.sun.com/developer/technicalArticles/J2SE/Desktop/mustang/beta2.html?feed=JSC
http://java.sun.com/javase/6/?feed=JSC
http://java.sun.com/developer/technicalArticles/JavaLP/javawebstart/AutoInstall.html?feed=JSC
http://java.sun.com/developer/technicalArticles/J2EE/injection/?feed=JSC
http://java.sun.com/developer/technicalArticles/J2SE/Desktop/sorted_jlist/?feed=JSC
http://java.sun.com/developer/technicalArticles/glassfish/ProjectTango/?feed=JSC
http://java.sun.com/developer/technicalArticles/WebServices/soa3/?feed=JSC
http://java.sun.com/javaone/sf/?feed=JSC
http://java.sun.com/javaone/sf/?feed=JSC
http://java.sun.com/javaee/downloads/index.jsp?feed=JSC
http://developers.sun.com/ajax/?feed=DSC
http://java.sun.com/javascript/?feed=JSC
http://java.sun.com/developer/technicalArticles/Interviews/ajax2006_qa.html?feed=JSC
http://java.sun.com/developer/technicalArticles/J2EE/jpa/?feed=JSC
And a lot more!
How can I just display the most recent links? In addition, how can I embed these into an HTML anchor < a href="" > tag with the title as descriptive text?
Many, many thanks!
[ September 15, 2006: Message edited by: Unnsse Khan ]
I agree. Here's the link:
http://aspose.com/file-tools
subject: RSS / JSTL Problem
Similar Threads
Problem deploying war file on WinXP
Help aggregating Atom feeds using JSTL
JasperException with RSS and JSTL
How to save values in a database in JSTL?
XML functionality not working on Tomcat 7.0.6
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter