欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

rsslibj

系統(tǒng) 1689 0
RSS是一個(gè)標(biāo)準(zhǔn)的XML文件,Rss閱讀器可以讀取這個(gè)XML文件獲得文章的信息,使用戶可以通過Rss閱讀器
而非瀏覽器閱讀Blog,我們只要?jiǎng)討B(tài)生成這個(gè)XML文件便可以了。RSSLibJ是一個(gè)專門讀取和生成RSS的小
巧實(shí)用的Java庫,大小僅25k,可以從 http://sourceforge.net/projects/rsslibj/ 下載rsslibj-

1_0RC2.jar和它需要的EXMLjar兩個(gè)文件,然后復(fù)制到web/WEB-INF/lib/下。
?
?

下載下來之后把 擴(kuò)張名.zip 改為 .jar 就行了。

Java代碼 復(fù)制代碼
  1. import ?com.rsslibj.elements.Channel; ??
  2. public ? class ?Writer?{ ??
  3. ???? public ? static ? void ?main(String[]?args)? ??
  4. ???????????? throws ?InstantiationException,?ClassNotFoundException,? ??
  5. ????????????IllegalAccessException?{ ??
  6. ????????Channel?channel= new ?Channel(); ??
  7. ????????channel.setDescription( "This?is?my?sample?channel." ); ??
  8. ????????channel.setLink( "http://localhost/" ); ??
  9. ????????channel.setTitle( "My?Channel" ); ??
  10. ????????channel.setImage( "http://localhost/" ,? ??
  11. ???????????????? "The?Channel?Image" ,? ??
  12. ???????????????? "http://localhost/foo.jpg" ); ??
  13. ????????channel.setTextInput( "http://localhost/search" ,? ??
  14. ???????????????? "Search?The?Channel?Image" ,? ??
  15. ???????????????? "The?Channel?Image" ,? ??
  16. ???????????????? "s" ); ??
  17. ????????channel.addItem( "http://localhost/item1" , ??
  18. ???????????????? "The?First?Item?covers?details?on?the?first?item>" , ??
  19. ???????????????? "The?First?Item" ) ??
  20. ????????????????.setDcContributor( "Joseph?B.?Ottinger" ); ??
  21. ????????channel.addItem( "http://localhost/item2" , ??
  22. ???????????????? "The?Second?Item?covers?details?on?the?second?item" , ??
  23. ???????????????? "The?Second?Item" ) ??
  24. ????????????????.setDcCreator( "Jason?Bell" ); ??
  25. ????????System.out.println( "The?feed?in?RDF:?" +channel.getFeed( "rss" )); ??
  26. ????} ??
  27. }??
Java代碼 復(fù)制代碼
  1. import ?com.rsslibj.elements.Channel; ??
  2. public ? class ?Writer?{ ??
  3. ???? public ? static ? void ?main(String[]?args)? ??
  4. ???????????? throws ?InstantiationException,?ClassNotFoundException,? ??
  5. ????????????IllegalAccessException?{ ??
  6. ????????Channel?channel= new ?Channel(); ??
  7. ????????channel.setDescription( "This?is?my?sample?channel." ); ??
  8. ????????channel.setLink( "http://localhost/" ); ??
  9. ????????channel.setTitle( "My?Channel" ); ??
  10. ????????channel.setImage( "http://localhost/" ,? ??
  11. ???????????????? "The?Channel?Image" ,? ??
  12. ???????????????? "http://localhost/foo.jpg" ); ??
  13. ????????channel.setTextInput( "http://localhost/search" ,? ??
  14. ???????????????? "Search?The?Channel?Image" ,? ??
  15. ???????????????? "The?Channel?Image" ,? ??
  16. ???????????????? "s" ); ??
  17. ????????channel.addItem( "http://localhost/item1" , ??
  18. ???????????????? "The?First?Item?covers?details?on?the?first?item>" , ??
  19. ???????????????? "The?First?Item" ) ??
  20. ????????????????.setDcContributor( "Joseph?B.?Ottinger" ); ??
  21. ????????channel.addItem( "http://localhost/item2" , ??
  22. ???????????????? "The?Second?Item?covers?details?on?the?second?item" , ??
  23. ???????????????? "The?Second?Item" ) ??
  24. ????????????????.setDcCreator( "Jason?Bell" ); ??
  25. ????????System.out.println( "The?feed?in?RDF:?" +channel.getFeed( "rss" )); ??
  26. ????} ??
  27. }??
      import com.rsslibj.elements.Channel;
public class Writer {
    public static void main(String[] args) 
            throws InstantiationException, ClassNotFoundException, 
            IllegalAccessException {
        Channel channel=new Channel();
        channel.setDescription("This is my sample channel.");
        channel.setLink("http://localhost/");
        channel.setTitle("My Channel");
        channel.setImage("http://localhost/", 
                "The Channel Image", 
                "http://localhost/foo.jpg");
        channel.setTextInput("http://localhost/search", 
                "Search The Channel Image", 
                "The Channel Image", 
                "s");
        channel.addItem("http://localhost/item1",
                "The First Item covers details on the first item>",
                "The First Item")
                .setDcContributor("Joseph B. Ottinger");
        channel.addItem("http://localhost/item2",
                "The Second Item covers details on the second item",
                "The Second Item")
                .setDcCreator("Jason Bell");
        System.out.println("The feed in RDF: "+channel.getFeed("rss"));
    }
}

    
?
Java代碼 復(fù)制代碼
  1. Channel?channel?=? new ?Channel();? ??
  2. channel.setDescription(account.getDescription());? ??
  3. baseUrl?=?baseUrl.substring( 0 ,?n);? ??
  4. channel.setLink( "http://server-name/home.c?accountId=" ?+?accountId);? ??
  5. channel.setTitle(account.getTitle());? ??
  6. List?articles?=?facade.getArticles(accountId,?account.getMaxPerPage(),? 1 );? ??
  7. Iterator?it?=?articles.iterator();? ??
  8. while (it.hasNext())?{? ??
  9. ????Article?article?=?(Article)it.next();? ??
  10. ????channel.addItem( "http://server-name/article.c?articleId=" ?+?article.getArticleId(),? ??
  11. ????????article.getSummary(),?article.getTitle()? ??
  12. ????);? ??
  13. }? ??
  14. //?輸出xml:? ??
  15. response.setContentType( "text/xml" );? ??
  16. PrintWriter?pw?=?response.getWriter();? ??
  17. pw.print(channel.getFeed( "rss" ));? ??
  18. pw.close();???
Java代碼 復(fù)制代碼
  1. Channel?channel?=? new ?Channel();? ??
  2. channel.setDescription(account.getDescription());? ??
  3. baseUrl?=?baseUrl.substring( 0 ,?n);? ??
  4. channel.setLink( "http://server-name/home.c?accountId=" ?+?accountId);? ??
  5. channel.setTitle(account.getTitle());? ??
  6. List?articles?=?facade.getArticles(accountId,?account.getMaxPerPage(),? 1 );? ??
  7. Iterator?it?=?articles.iterator();? ??
  8. while (it.hasNext())?{? ??
  9. ????Article?article?=?(Article)it.next();? ??
  10. ????channel.addItem( "http://server-name/article.c?articleId=" ?+?article.getArticleId(),? ??
  11. ????????article.getSummary(),?article.getTitle()? ??
  12. ????);? ??
  13. }? ??
  14. //?輸出xml:? ??
  15. response.setContentType( "text/xml" );? ??
  16. PrintWriter?pw?=?response.getWriter();? ??
  17. pw.print(channel.getFeed( "rss" ));? ??
  18. pw.close();???
      Channel channel = new Channel(); 
channel.setDescription(account.getDescription()); 
baseUrl = baseUrl.substring(0, n); 
channel.setLink("http://server-name/home.c?accountId=" + accountId); 
channel.setTitle(account.getTitle()); 
List articles = facade.getArticles(accountId, account.getMaxPerPage(), 1); 
Iterator it = articles.iterator(); 
while(it.hasNext()) { 
    Article article = (Article)it.next(); 
    channel.addItem("http://server-name/article.c?articleId=" + article.getArticleId(), 
        article.getSummary(), article.getTitle() 
    ); 
} 
// 輸出xml: 
response.setContentType("text/xml"); 
PrintWriter pw = response.getWriter(); 
pw.print(channel.getFeed("rss")); 
pw.close(); 

    
?
Java代碼 復(fù)制代碼
  1. import ?com.rsslibj.elements.Channel; ??
  2. ??
  3. public ?classWriter{ ??
  4. ???? public ? static ? void ?main(String[]?args)? ??
  5. ???????? throws ?InstantiationException,ClassNotFoundException,IllegalAccessException?{ ??
  6. ???????? ??
  7. ????????Channel?channel?=? new ?Channel(); ??
  8. ????????channel.setDescription( "Thisismysamplechannel." ); ??
  9. ????????channel.setLink( "/" ); ??
  10. ????????channel.setTitle( "MyChannel" ); ??
  11. ????????channel.setImage( "/" ,? "TheChannelImage" ,? "/foo.jpg" ); ??
  12. ????????channel.setTextInput( "/search" ,? "SearchTheChannelImage" ,? "TheChannelImage" ,? "s" ); ??
  13. ????????channel.addItem( "/item1" ,? "TheFirstItemcoversdetailsonthefirstitem>" ,? ??
  14. ???????????????? "TheFirstItem" ).setDcContributor( "JosephB.Ottinger" ); ??
  15. ????????channel.addItem( "/item2" ,? "TheSecondItemcoversdetailsontheseconditem" , ??
  16. ???????????????? "TheSecondItem" ).setDcCreator( "JasonBell" ); ??
  17. ????????System.out.println( "ThefeedinRDF:" ?channel.getFeed( "rdf" )); ??
  18. ????} ??
  19. }??

rsslibj


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 国产一区二区三区免费观看 | 亚洲一区在线播放 | 日日操夜夜透 | 暖暖av| 久久久青草 | 成人性视频免费网站 | 日韩一区二区中文字幕 | 日韩精品一区二区三区 | 蜜臀在线播放 | 久久久久久综合一区中文字幕 | 亚洲一区中文字幕在线观看 | a毛片久久免费观看 | 91短视频版在线观看www免费 | 天天色天天| 成人精品一区二区 | jizz国产精品免费麻豆 | 久久伊人色综合 | 久久免费国产视频 | 欧美成人性性 | 免费视频日韩 | 日韩在线亚洲 | 欧美性色黄大片www 成人免费播放视频777777 | 欧美一级毛片在线播放 | 九九这里只有精品视频 | 国产精品视频99 | 中文字幕亚洲一区二区三区 | 国产欧美精品一区二区三区 | 亚洲视频观看 | 欧美精品 在线观看 | 国产九九免费视频网站 | 色老头xxxwww作爱视频 | 国产真人做爰视频免费 | 性欧美精品久久久久久久 | av黄色在线免费观看 | 国产精品久久久久秋霞影视 | 手机看片国产免费现在观看 | 久久精品国产线看观看亚洲 | 精一区二区 | 色婷婷天天综合在线 | 奇米第四色网站 | 波多野结衣全集在线观看 |