使用JAVA rss4j包制作RSS文件

博客涉及Java、RSS、网络编程等信息技术内容,包含网络套接字等相关特性,可能还与图像方面有一定关联。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用JAVA rss4j包制作RSS文件
作者 冷月宫主 发表于 2004-10-12 18:42:30
================================================
=下载:http://www.churchillobjects.com/soft/rss4j/rss4j092.jar
================================================
=浏览:http://www.churchillobjects.com/c/13005.html
================================================
=需求:http://xml.apache.org/xerces2-j/index.html
================================================
安装:1解压 rss4j092包,获得rss4j.jar拷贝到{your wwwrooo}/WEB-INF/lib/
2解压在xerces2-j下的zip包,把里面的几个JAR文件拷贝到{your wwwrooo}/WEB-INF/lib/

<cfscript>
doc=createObject("java","churchillobjects.rss4j.RssDocument");
doc.setVersion(doc.VERSION_10);

// create and add a new channel
channel =createObject("java","churchillobjects.rss4j.RssChannel"); 
channel.setChannelTitle("ChurchillObjects.com Features");
channel.setChannelLink("http://www.churchillobjects.com");
channel.setChannelDescription("Advanced Object-Oriented Developer Resource");
channel.setChannelUri("http://www.churchillobjects.com/rss/");
doc.addChannel(channel);

// create and add two items

item1 = createObject("java","churchillobjects.rss4j.RssChannelItem"); 
item1.setItemTitle("Networking Apps With Redenzvous");
item1.setItemLink("http://www.churchillobjects.com/c/11028.html");
item1.setItemDescription("Avoid the difficulties of internetworked applications with this fast, robust framework package.");
channel.addItem(item1);

item2 = createObject("java","churchillobjects.rss4j.RssChannelItem"); 
item2.setItemTitle("Secure Sockets with JSSE & OpenSSL");
item2.setItemLink("http://www.churchillobjects.com/c/11201.html");
item2.setItemDescription("Find out how to implement robust secure communnications between your clients and servers, including making your own certificate authority.");
channel.addItem(item2);

// create and add an image for the channel
img = createObject("java","churchillobjects.rss4j.RssChannelImage");
img.setImageLink("http://www.churchillobjects.com");
img.setImageUrl("http://www.churchillobjects.com/i/co.gif");
img.setImageTitle("ChurchillObjects.com");
channel.setChannelImage(img);
rfile=createObject("java","java.io.File");
rfile.init(JavaCast('string', "c:/rss.xml"));
RssGenerator=createObject("java","churchillobjects.rss4j.generator.RssGenerator");
</cfscript>
<cftry>
  <cfset RssGenerator.generateRss(doc, rfile)>
  成功
  <cfcatch type="any">
  出错
  </cfcatch>
</cftry>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值